我也是刚刚知道:
var
info: TBitmapInfo;
bmpCap: TBitmap;
begin
result := 0;
capGetVideoFormat(hWnd, @info, sizeof(TBitmapInfo));
bmpCap := TBitmap.Create;
FrameToBitmap(bmpCap, lpvhdr^.lpData, info);
........
bmpCap.Free;
end;
procedure FrameToBitmap(Bitmap: TBitmap;
FrameBuffer: pointer;
BitmapInfo: TBitmapInfo);
begin
with Bitmapdo
begin
Width := BitmapInfo.bmiHeader.biWidth;
// New size of Bitmap
Height := Bitmapinfo.bmiHeader.biHeight;
setDiBits(canvas.handle, handle, 0, BitmapInfo.bmiHeader.biheight,
FrameBuffer, BitmapInfo, DIB_RGB_COLORS);
end;
end;