Design VCD player with VB

zhaozj2021-02-11  161

Design VCD player with VB

Http://www.tongyi.net Click: 660

When you are using the old name of xingplay or gorgeous "Super Sight 5.0", have you ever thought about having a soft solution player you have written by yourself? In fact, you only need to master a little VB skill, then you have to achieve this Wish becomes very simple. The author has founded the SYSTEM.INI of Windows in the initial study, and the MPEG compressed file (such as a VCD2.0 version of the .dat file) can be opened via VB's multimedia control MCI.vbx. First of all, you need to have MPEGVIDEO items in [MCI] in [MCI] in your Windows system (in general Windows95 and Windows 98, you can also add this item). Second, a new window is created in VB, add MCI.vbx to Toolbox, drag and drop the MCI control to form FORM, adjust its size, and nine buttons (from left to right: prev, next, play, pause , BACK, STEP, STOP, RECORD, and EJECT, the Record button Visible property is set to false, the remaining button's Visible property and the enabled property are set to True, and the settings of the above buttons can be set by "custom" items in the properties column of MMControl. . Assume that the optical drive is E:, the VCD disc file is E: /MPEGAV /MUSIC01.DAT. Source code is as follows: Private Sub Form_ Load () MMControl.DeviceType = "MPEGVideo" MMControl.Name = "E: /MPEGAV/MUSIC01.DAT" MMControl.Command = "OPEN" MMControl.Command = "PLAY" End Sub Sub Form_Unload ( Cancel as integer = "close" End Sub author discovered that the STEP and BACK button function were not obvious, so some of the above two buttons were improved. Sub MMControl_ StepClick (Cancel As Integer) j = 100 to forward an amount MMControl.Position 100 'values ​​can be appropriately adjusted If j> MMControl.Length Then MMControl.From = MMControl.Length Else MMControl.From = j End If MMControl.Command = " Play "End Sub MMControl_ backclick (Cancel AS Integer) i = mmControl.position-100 'value 100 After retirement, appropriate adjustment of I <0 Then mmControl.From = 0 else mmcontrol.From = I end if mmcontrol.command = "Play" End Sub MCI controls There are also many properties, such as the screen play position hwnddisplay attribute, etc., readers can refer to the relevant information, and will not be introduced here. The reader can also open the file by establishing a general dialog box to solve the problem with the VCD file name is not uniform or multi-file. Adjust the title, icon, color, etc. of the form form, then compile into EXE files, you can have your own VCD player under Windows. In addition, the quality and sound quality of playback screen will differ depending on the performance difference between computer performance and the quality of VCD decoding.

转载请注明原文地址:https://www.9cbs.com/read-5444.html

New Post(0)