OnMouseMove
property OnMouseMove: TOnVideoMouseMove read FOnMouseMove write FOnMouseMove;
__property TOnVideoMouseMove OnMouseMove = {read=FOnMouseMove, write=FOnMouseMove};
typedef void __fastcall (__closure *TOnVideoMouseMove)(System::TObject* Sender, System::LongInt VideoWindow, System::Classes::TShiftState Shift, System::LongInt X, System::LongInt Y);
void SetOnMouseMove (TOnMouseMoveCb OnMouseMoveCb);
typedef void CALLBACK TOnMouseMoveCb (void *Object, void *Sender, int VideoWindow, int Shift, int X, int Y);
Occurs when the user moves the mouse pointer while the mouse pointer is over a control.
-
if TranslateMouseCoordinates is enabled: this event returns the video frame coordinates corresponding to the native video size. Therefore the event does not occur if the mouse is moved out of the video window.
-
if TranslateMouseCoordinates is disabled: the normal OnMouseUp event occurs and returns the usual mouse coordinates over the video window, as well as out of the video window if the mouse has been clicked within the video window and then moved out of it.
The difference appears when Display_AutoSize is disabled or PreviewZoomSize <> 100. In this case, the event reports the corresponding native video source coordinate, necessary to draw objects over video frames from the OnFrameBitmap event. Note that the BitmapInfo parameter of the OnFrameBitmap event returns directly the current mouse information. Note: to detect if the video is displayed when the event occurs, test VideoWindow <> -1. E.g.:
procedure TfrmMainForm.VideoGrabberMouseMove(Sender: TObject; VideoWindow: Integer; Shift: TShiftState; X, Y: Integer); begin if VideoWindow <> -1 then begin // if the video is displayed if chkFreeHandEnabled.Checked then begin ... ... end; end; end;