This sample illustrates how to capture a video from a webcam and buffer it on a form, using FireMonkey.
You can find the FireMonkey ImageSpin sample project at:
- Start | Programs | Appmethod 1.16 | Samples, and then navigate to Object Pascal\FireMonkey Desktop\VideoCaptureHD.
- Subversion Repository for Object Pascal: http://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RadStudio_XE8//Object%20Pascal/FireMonkey%20Desktop/VideoCaptureHD/
This application uses TVideoCaptureDevice in order to implement video capture capabilities.
How to Use the Sample
Make sure that you have connected to your station a video capture device (a webcam). When the application starts running, the connected video capture device starts capturing and the image is displayed on the center of the form. In the upper-left corner there is a green ellipse that indicates if the application is capturing video images. Use the stop button from the upper-right side of the form to stop capturing. If the capturing is stopped, the ellipse from the upper-left corner is totally transparent. Save the current displayed frame of the captured video using the Save to Bitmap... button.
- Navigate to the location give above, and open VideoCaptureHD.dproj.
- Press F9 or choose Run > Run.
CaptureForm.pas represents the main window unit of the sample. It contains the TForm240 class, which defines the main form and contains:
- A TVideoCaptureDevice object.
- Two TSpeedButton objects.
- A TImage object.
- A TSaveDialog object.
- A TEllipse object.
- A TLayout object.
- Requests access to the video capture device.
- Displays the captured images on the TImage.
- Implements the actions to be attached to each control that allows to manipulate the capturing process.