Skip to content

SetFrameCaptureBounds

function

Delphi
procedure SetFrameCaptureBounds (LeftPosition: LongInt; TopPosition: LongInt; RightPosition: LongInt; BottomPosition: LongInt);
C++Builder
void __fastcall SetFrameCaptureBounds(System::LongInt LeftPosition, System::LongInt TopPosition, System::LongInt RightPosition, System::LongInt BottomPosition);
C#
public void SetFrameCaptureBounds(int LeftPosition, int TopPosition, int RightPosition, int BottomPosition);
VB.NET
Public Sub SetFrameCaptureBounds(LeftPosition As Integer, TopPosition As Integer, RightPosition As Integer, BottomPosition As Integer)
C++/Qt
void SetFrameCaptureBounds (int LeftPosition, int TopPosition, int RightPosition, int BottomPosition);

Specifies a rectangle for the frame capture, to capture only part of the video frame.

E.g. Button1 action:

VideoGrabber.StartPreview()

Button2 action:

VideoGrabber.SetFrameCaptureBounds (50, 50, 150, 150)
VideoGrabber.CaptureFrameTo (fc_JpegFile, "mysquarecapture.jpg")

When the preview is started with Button1 and a frame is then captured with Button2, the captured frame is a 100x100 square image captured at the x=50 y=50 location of the video frame.

The normal full frame capture can then be restored by invoking SetFrameCaptureBounds (0, 0, 0, 0).

Top-down or left-right capture: the captured frame can also be flipped top-down or left-right, by inverting the Left/Right or Top/Bottom values. E.g. to capture a top-down frame:

VideoGrabber.SetFrameCaptureBounds (50, 150, 150, 50)

To retrieve the current size of the video frame, use VideoWidth and VideoHeight.