//保存为bmp记得uses jpeg;
//调用示例:SaveToJpg(strtoint(Edit2.Text),'C:/TVideoCap/DEMO1/captest.jpg');
procedure SaveToJpg(Quality: Integer; FileName: string);
var
DC: HDC;
bmp: TBitmap;
jpg: TJpegImage;
W, H: Integer;
begin
bmp:=TBitmap.Create;
jpg:=TJpegImage.Create;
DC:=GetDC(Main.VideoCap1.Handle);
W:=Main.VideoCap1.BitmapInfo.bmiHeader.biWidth;
H:=Main.VideoCap1.BitmapInfo.bmiHeader.biHeight;
try
jpg.PixelFormat:=jf24Bit;
bmp.PixelFormat:=pf24bit;
bmp.Width:=W;
bmp.Height:=H;
BitBlt(bmp.Canvas.Handle, 0, 0, W, H, DC, 0, 0, SRCCOPY);
jpg.CompressionQuality:=Quality;
jpg.Assign(bmp);
jpg.SaveToFile(FileName);
finally
bmp.Free;
jpg.Free;
ReleaseDC(Main.VideoCap1.Handle, DC);
end;
end;