Skip to content

RetrieveInitialXYAfterRotation

function

Delphi
procedure RetrieveInitialXYAfterRotation (X: LongInt; Y: LongInt; var Original_X: OleVariant; var Original_Y: OleVariant);
C++Builder
void __fastcall RetrieveInitialXYAfterRotation(System::LongInt X, System::LongInt Y, System::LongInt &OriginalX, System::LongInt &OriginalY);
C#
public void RetrieveInitialXYAfterRotation(int X, int Y, ref int OriginalX, ref int OriginalY);
VB.NET
Public Sub RetrieveInitialXYAfterRotation(X As Integer, Y As Integer, ByRef OriginalX As Integer, ByRef OriginalY As Integer)
C++/Qt
void RetrieveInitialXYAfterRotation (int X, int Y, int *OriginalX, int *OriginalY);

Retrieves the initial frame coordinates after a VideoProcessing_Rotation has been applied and OverlayAfterTransform is enabled. This procedure is used mainly to make a drawing from the OnFrameOverlayUsingDC event that is not rotated when OverlayAfterTransform is enabled.

E.g.:

procedure TfrmMainForm.VideoGrabberFrameOverlayUsingDC(Sender: TObject; Dc: HDC; FrameNumber: Cardinal; FrameTime: Int64; FrameId: Integer);

var

Canvas: TCanvas;

SrcX, SrcY: LongInt;

DestX, DestY: LongInt;

begin

Canvas := TCanvas.Create;

Canvas.Handle := Dc;

Canvas.Pen.Color := clWhite;

VideoGrabber.RetrieveInitialXYAfterRotation (100, 100, SrcX, SrcY);

VideoGrabber.RetrieveInitialXYAfterRotation (100, 200, DestX, DestY);

Canvas.MoveTo (SrcX, SrcY);

Canvas.Pixels[SrcX, SrcY] := clWhite;

Canvas.LineTo (DestX, DestY);

Canvas.Free;

end;