Skip to content

OnMouseUp

event

Delphi
property OnMouseUp: TOnVideoMouseUpDown read FOnMouseUp write FOnMouseUp;
C++Builder
__property TOnVideoMouseUpDown OnMouseUp = {read=FOnMouseUp, write=FOnMouseUp};
typedef void __fastcall (__closure *TOnVideoMouseUpDown)(System::TObject* Sender, System::LongInt VideoWindow, System::Uitypes::TMouseButton Button, System::Classes::TShiftState Shift, System::LongInt X, System::LongInt Y);
C++/Qt
void SetOnMouseUp (TOnMouseUpCb OnMouseUpCb);
typedef void CALLBACK TOnMouseUpCb (void *Object, void *Sender, int VideoWindow, TMouseButton Button, TMouseButton Shift, int X, int Y);

Occurs when the user releases a mouse button that was pressed with the mouse pointer over a component.

If TranslateMouseCoordinates is disabled, the normal OnMouseUp event occurs and returns the real mouse coordinates across the control. If TranslateMouseCoordinates is enabled, this event returns the coordinates corresponding to the native video size.

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.VideoGrabberMouseUp(Sender: TObject; VideoWindow: Integer; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if VideoWindow <> -1 then begin // if the video is displayed if chkFreeHandEnabled.Checked then begin ... ... end; end; end;