My First Convert (Visual FoxPro 6.0)

The ltmmConvertCtrl object allows the user to recompress multimedia files or convert from one multimedia format to another. Using the following steps:

1.

Start Visual FoxPro 6.

2.

If you didn’t install LEAD Multi-Media controls before, install them.

On the Tools pull-down menu, choose Options… and go to the Controls tab. Click the ActiveX controls radio button. Mark the ltmmConvertCtrl Class and click the Set As Default button, then click OK.

3.

Create a new blank form. On the Form controls toolbar, press the View Classes button and select ActiveX controls. Add the ltmmConvertCtrl to your form and change its name to ltmmConvertCtrl1.

4.

Code the Form Init procedure as follows:

With ThisForm.ltmmConvertCtrl1
   && Define the input file. 
   .SourceFile = "c:\source.avi"
   && Define the target or output file. 
   .TargetFile = "c:\Target.avi"
   && select the LEAD compressor
   .VideoCompressors.Selection = ThisForm.ltmmConvertCtrl1.VideoCompressors.Find ("device:sw:{33D9A760-90C8-11D0-BD43-00A0C911CE86}\LEAD MCMP/MJPEG Codec A COmpressor Also known as an encoder, this is a module or algorithm to compress data. Playing that data back requires a decompressor, or decoder. combined with a DECompressor, or encoder Also known as compressor, this is a module or algorithm to compress data. Playing that data back requires a decompressor, or decoder. and a decoder Also known as a decompressor, this is a module or algorithm to decompress data., which allows you to both compress and decompress that same data. (2.0)")
EndWith

5.

Add a command button to your control, and name it as follows:

 

Name

Caption

 

btnStartConvert

Start Convert

6.

Code the btnStartConvert Click procedure as follows.

&& start the conversion
ThisForm.ltmmConvertCtrl1.StartConvert
MessageBox("Converting started...") 

7.

Run your program to test it.