OnFrameBitmap
property OnFrameBitmap: TOnFrameBitmap read FOnFrameBitmap write FOnFrameBitmap;
__property TOnFrameBitmap OnFrameBitmap = {read=FOnFrameBitmap, write=FOnFrameBitmap};
typedef void __fastcall (__closure *TOnFrameBitmap)(System::TObject* Sender, pFrameInfo FrameInfo, pFrameBitmapInfo BitmapInfo);
public event OnFrameBitmapEventHandler OnFrameBitmap;
public delegate void OnFrameBitmapEventHandler(object sender, TOnFrameBitmapEventArgs e);
Public Event OnFrameBitmap As OnFrameBitmapEventHandler
Public Delegate Sub OnFrameBitmapEventHandler(sender As Object, e As TOnFrameBitmapEventArgs)
void SetOnFrameBitmap (TOnFrameBitmapCb OnFrameBitmapCb);
typedef void CALLBACK TOnFrameBitmapCb (void *Object, void *Sender, TFrameInfo *FrameInfo, TFrameBitmapInfo *BitmapInfo);
Gives access to each frame bitmap
Remarks
This event occurs for each frame bitmap when the FrameGrabber is enabled.
To perserve the performance while offering a lot of useful values, this event returns 2 parameters that are pointers to structures:
A) the FrameInfo parameter, that is a pointer to a TFrameInfo structure.
It returns time and frame number information about the current video frames
B) the BitmapInfo parameter, which is a pointer to a TFrameBitmapInfo structure.
It returns all the useful bitmap information, and also the current mouse information (current position, last clicked position, button states, mouse down, etc...)
From this event it is possible to perform powerful bitmap tasks, like line drawing, mouse-based drawing, pixel modifications, etc...
A lot of sample code is available in the OnFrameBitmap event of the MainDemo project (seach "FrameBitmap" in the MainForm)To activate this sample code, run the MainDemo project -> the chekboxes are located in the "Overlay" tab.
NOTE:
-
from this event do not perform any actions with the potential to block:1. do not hold a critical section or wait on another thread,
-
do not call any GDI or USER32.DLL APIs that might cause a window to move,
-
do not invoke component properties that send messages, e.g. do not read the ItemIndex property of a ListBox component. To read a such property, set an intermediary variable when the property changes, and then read the intermediary variable from the OnFrameOverlay... event.
-
to perform blocking operations from this event, enable the OnFrameBitmapEventSynchroneVidGrab.TVideoGrabber.OnFrameBitmapEventSynchrone property. Enabling the OnFrameBitmapEventSynchrone property may slow down the application and/or introduce latency in the video stream.