TVideoGrabber.GetLastFrameAsHBITMAP

Prev

Next

TVideoGrabber

Methods

 




































































































Returns the last video frame as a HBITMAP memory bitmap handle


Declaration
function GetLastFrameAsHBITMAP (BufferIndex: LongInt; WithOverlays: Boolean; SrcLeftLocation: LongInt; SrcTopLocation: LongInt; SrcWidth: LongInt; SrcHeight: LongInt; DestWidth: LongInt; DestHeight: LongInt; BitmapColorBitCount: LongInt): HBITMAP;


HBITMAP __fastcall GetLastFrameAsHBITMAP(int BufferIndex, bool WithOverlays, int SrcLeftLocation, int SrcTopLocation, int SrcWidth, int SrcHeight, int DestWidth, int DestHeight, int BitmapColorBitCount);


function GetLastFrameAsHBITMAP (BufferIndex as Long, WithOverlays as Bool, SrcLeftLocation as Long, SrcTopLocation as Long, SrcWidth as Long, SrcHeight as Long, DestWidth as Long, DestHeight as Long, BitmapColorBitCountas Long) as Long

Description

Used to get the last video frame as a memory bitmap.

The function returns a HBITMAP bitmap handle.

Don't forget to invoke DeleteObject (bitmap handle) to release the memory when you have done with the bitmap, otherwise you will quick run out of memory.

BufferIndex: LongInt;
0 = the current video frame (usual value)
1 = the previous video frame (n-1)
2 = the video frame n-2
...
(the size of the buffer may vary, usually don't try to use frames older than n-4)
If the index is out of the buffer the function return 0

WithOverlays: Boolean;
if false, the native frame without overlays is returned
if true, the frame with overlays applied is returned

SrcLeftLocation: LongInt;
x location of the rectangle to capture (usually 0 for a full frame)

SrcTopLocation: LongInt;
y location of the rectangle to capture (usually 0 for a full frame)

SrcWidth: LongInt;
width of the rectangle to capture (usually 0 for a full width)

SrcHeight: LongInt;
height of the rectangle to capture (usually 0 for a full height)

DestWidth: LongInt;
width of the desired bitmap (0 will return a bitmap having the source width)

DestHeight: LongInt;
height of the desired bitmap (0 will return a bitmap having the source height)

BitmapColorBitCount: LongInt
color bit count of the desired bitmap. Valid values are 32, 24, 16, 15, 8.
0 returns a bitmap having the same color count than the video frame (usually 24 or 32, depending on the FrameGrabberRGBFormat setting)

E.g.:

BitmapHandle = VideoGrabber.GetLastFrameAsTBitmap (0, false, 0, 0, 0, 0, 0, 0, 0)
returns the last video frame without overlays in its current size

BitmapHandle = VideoGrabber.GetLastFrameAsTBitmap (0, false, 0, 0, 0, 0, 320, 240, 8)
returns the previous video frame with overlays as a 320x240 bitmap, 8 bits color


See Also
TAutoFileName TFrameCaptureDest TOnFrameCaptureCompleted BurstCount BurstInterval BurstMode BurstType CaptureFrameSyncTo CaptureFrameTo FrameCaptureHeight FrameCaptureWidth FrameCaptureWithoutOverlay FrameCaptureZoomSize GetFrameInfoString GetLastFrameAsTBitmap GetLastFrameBitmapBits GetLastFrameBitmapBits2 GetLastFrameWaitTimeoutMs JPEGPerformance JPEGProgressiveDisplay JPEGQuality Last_BurstFrameCapture_FileName Last_CaptureFrameTo_FileName OnDiskFull OnFrameBitmap SetFrameCaptureBounds StoragePath WebcamStillCaptureButton