熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Delphi編程 >> 正文

Delphi中把bmp圖片轉換成jpg圖片

2022-06-13   來源: Delphi編程 

//bmp圖片轉換成jpg圖片
function fun_BmpToJpg(temp path: String; ACQ: Integer): Boolean; stdcall;
var
  MyJpeg: TJpegImage;
  Bmp: TBitmap;
begin
  result := false; 
  if FileExists(temp) then
  begin
    Bmp:= TBitmapCreate;
    MyJpeg:= TJpegImageCreate;
    BmpLoadFromFile(temp);
    MyJpegAssign(Bmp);
    MyJpegCompressionQuality := ACQ;
    MyJpegCompress;
    MyJpegSaveToFile(Path);
    MyJpegfree;
    Bmpfree;
    if FileExists(path) then
      result := True;
  end;
end;
該文章轉載自網絡大本營
From:http://tw.wingwit.com/Article/program/Delphi/201311/24693.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.