My First Capture (Delphi 6.0)

Using the following steps to create a Delphi 6.0 project and use MM Capture control to capture video data:

1.

Start Delphi 6.

2.

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

On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD Multi-Media Library (14), and Press install, and then compile and install the package dclusr.dpk.

3.

From the ActiveX controls tab; add the ltmmCaptureCtrl to your form. Size and position the control, as you want it to appear at run time.

4.

Handle the Form1 OnCreate event, and code FormCreate procedure as follows:

procedure TForm1.FormCreate(Sender: TObject);
begin
   //select first video device
   ltmmCaptureCtrl1.VideoDevices.Selection:= 0; 
   //use preview
   ltmmCaptureCtrl1.Preview:= True; 
end;

5.

Add two buttons and name them as follows:

 

Name

Caption

 

btnStartCapture

Start Capture

 

btnStopCapture

Stop Capture

6.

Handle the btnStartCapture OnClick event, and code btnStartCaptureClick procedure as follows:

procedure TForm1.btnStartCaptureClick(Sender: TObject);
begin
   ltmmCaptureCtrl1.StartCapture ( ltmmCapture_Mode_Video ) ;
end;

7.

Handle the btnStopCapture OnClick event, and code btnStopCaptureClick procedure as follows:

      procedure TForm1.btnStopCaptureClick(Sender: TObject);
      begin
   ltmmCaptureCtrl1.StopCapture ( );
      end;

8.

Run your program to test it.

9.

Save this project to use it as initial point for other tutorials.