首页 > 代码库 > bmp to jpg

bmp to jpg

uses Jpeg;
function BMPtoJPG(var BMPpic, JPGpic: string): boolean;
var
  Bitmap: TBitmap;
  JpegImg: TJpegImage;
begin
  result := False;
  Bitmap := TBitmap.Create;
  try
    Bitmap.LoadFromFile(BMPpic);
    JpegImg := TJpegImage.Create;
    try
      JpegImg.Assign(Bitmap);
      JpegImg.SaveToFile(JPGpic);
      result := True;
    finally
      JpegImg.Free
    end;
  finally
    Bitmap.Free
  end;
end;






来自为知笔记(Wiz)