BMP转换为JPEG

Var
MyJPEG : TJPEGImage;
MyBMP : TBitmap;
begin
MyBMP := TBitmap.Create;
with MyBMP do
try
LoadFromFile('C:/DEMO.BMP');
MyJPEG := TJPEGImage.Create;
with MyJPEG do begin
Assign(MyBMP);
CompressionQuality:=10;
Compress;
SaveToFile('C:/DEMO.JPG');
Free;
end;
finally
Free;
end;
end;

你可能感兴趣的:(BMP转换为JPEG)