Skip to content

CaptureFrameTo

function

Delphi
function CaptureFrameTo (Dest: TFrameCaptureDest; FileName: string): Boolean;
C++Builder
bool __fastcall CaptureFrameTo(TFrameCaptureDest Dest, System::UnicodeString FileName);
C#
public bool CaptureFrameTo(TFrameCaptureDest Dest, string FileName);
VB.NET
Public Function CaptureFrameTo(Dest As TFrameCaptureDest, FileName As String) As Boolean
C++/Qt
BOOL CaptureFrameTo (TFrameCaptureDest Dest, wchar_t *FileName);

Asynchronously captures the next video frame, depending on the Dest parameter (TFrameCaptureDest type):

  • fc_TBitmap: to a memory bitmap,

  • fc_BmpFile: to a BMP file,

  • fc_JpegFile: to a JPEG file,

  • fc_Clipboard: to the clipboard (CF_BITMAP format),

  • fc_TiffFile: to a TIFF file,

  • fc_PngFile: to a PNG file,

  • fc_TBitmapTopdown: to a top-down memory bitmap (same as fc_TBitmap, with the scanlines stored from top to bottom).

The frame grabber must be enabled to use this function. The video frame is returned asynchronously by the OnFrameCaptureCompleted event.

To let TVideoGrabber generate the file name automatically when capturing the frame to an image file (Dest = fc_BmpFile, fc_JpegFile, fc_TiffFile or fc_PngFile), pass an empty string in the FileName parameter. The file name is then generated in the StoragePath directory according to AutoFileName and AutoFilePrefix, e.g.:

CaptureFrameTo (fc_JpegFile, '');

Otherwise, specify the path/file name of the image in the FileName parameter.