dxCameraControl抓拍并压缩jpeg

//由于dxCameraControl 直接拍照图片保存普遍比较大,大约3M左右,故需要压缩
procedure TFormMain.capturePic(tmpStr: string); var filePathName: string; JPEGImage: TJPEGImage; begin if Trim(spath) <> '' then begin if not DirectoryExists(spath) then begin ForceDirectories(spath); end; filePathName := spath + tmpStr+ '.jpg'; // dxCameraControl1.CapturedBitmap.CompressData := True; dxCameraControl1.Capture; // dxCameraControl1.CapturedBitmap.Height := 600; // dxCameraControl1.CapturedBitmap.Width := 800; cxImage1.Picture.Assign(dxCameraControl1.CapturedBitmap); cxImage1.Picture.SaveToFile(filePathName); JPEGImage := TJPEGImage.Create; JPEGImage.Assign(cxImage1.Picture.Graphic); JPEGImage.CompressionQuality := 25; JPEGImage.Compress; JPEGImage.SaveToFile(filePathName); end; end;

 

上一篇:关于 QiuZH's 博客园界面美化教程


下一篇:cropper.js的潜在Bug