SendImageToVideoFromBitmaps
function SendImageToVideoFromBitmaps (ImageFilePath: string; BitmapHandle: HBITMAP; CanFreeBitmapHandle: Boolean; EndOfData: Boolean): Boolean;
bool __fastcall SendImageToVideoFromBitmaps(System::UnicodeString ImageFilePath, HBITMAP BitmapHandle, bool CanFreeBitmapHandle, bool EndOfData);
public bool SendImageToVideoFromBitmaps(string ImageFilePath, IntPtr BitmapHandle, bool CanFreeBitmapHandle, bool EndOfData);
Public Function SendImageToVideoFromBitmaps(ImageFilePath As String, BitmapHandle As IntPtr, CanFreeBitmapHandle As Boolean, EndOfData As Boolean) As Boolean
BOOL SendImageToVideoFromBitmaps (wchar_t *ImageFilePath, HBITMAP BitmapHandle, BOOL CanFreeBitmapHandle, BOOL EndOfData);
Passes the image or bitmap handle to TVideoGrabber when VideoSource = vs_JPEGsOrBitmaps: in this mode, TVideoGrabber needs the video frames to be passed by SendImageToVideoFromBitmaps or SendImageToVideoFromBitmaps2.
SendImageToVideoFromBitmaps can be invoked:
-
either from the OnVideoFromBitmapsNextFrameNeeded event, which occurs periodically to request the next frame;
-
or periodically and directly. In this 2nd case, SendImageToVideoFromBitmaps must be called once just before invoking StartPreview or StartRecording.
Pass either a file path to a BMP or JPEG file through the ImageFilePath parameter (and set BitmapHandle to 0), or a bitmap handle through the BitmapHandle parameter. With a bitmap handle, set CanFreeBitmapHandle to true if TVideoGrabber must free the bitmap handle, or to false to reuse the bitmap later. If no more images are available, set EndOfData to true to notify the end of the recording or preview.
See Video clips built on the fly by passing bitmap handles, BMP or JPEG files for more information.
Sample code is available in the MainDemo project included in the package, or in the VideoFromBitmapHandles or VideoFromBMPorJPEGfiles demos.