TOnFrameOverlayUsingDIB
TOnFrameOverlayUsingDIB = procedure (Sender: TObject; FrameBitmapHandle: LongInt; FrameNumber: LongWord_; FrameTime: LargeInteger; FrameId: LongInt) of object;
Type of the OnFrameOverlayUsingDIB event.
FrameBitmapHandle: handle of the bitmap of the current video frame
FrameId: must be passed to GetFrameInfo to retrieve information about the current frame.
Use GetObject to retrieve the DIB section information. E.g.:
procedure TfrmMainForm.VideoGrabberFrameOverlayUsingDIB(Sender: TObject;
FrameBitmapHandle: HBITMAP; FrameNumber: Cardinal; FrameTime: Int64;
FrameId: Integer);
var
DibSection: TDibSection;
i: integer;
SkipLine: boolean;
begin
if GetObject (FrameBitmapHandle, sizeof (TDibSection), @DibSection) = 0 then Exit;
SkipLine := false;
for i := 0 to DibSection.dsBm.bmHeight - 1 do begin
if SkipLine then begin
ZeroMemory (Pointer (Integer(DibSection.dsBm.bmBits) + (i DibSection.dsBm.bmWidthBytes)), DibSection.dsBm.bmWidthBytes);
end;
SkipLine := not SkipLine;
end;
end;