procedure TfrmLevelPic.SaveAsJPG(FnameMap:string) ;
var
jp: TJPEGImage;
begin
jp := TJPEGImage.Create;
try
with jp do
begin
jp.CompressionQuality := 75;
jp.Compress ;
Assign(Image1.Picture.Bitmap);
SaveToFile(FnameMap+'.jpg');
end;
finally
jp.Free;
end;
end;
////---读入方法如下:
procedure TfrmLevelPic.OpenJPGInImage(Fnamemap:string);
var
jp: TJPEGImage;
begin
jp := TJPEGImage.Create;
jp.LoadFromFile(Fnamemap);
try
with jp do
begin
Image1.Picture.Bitmap.Assign(jp);
end;
finally
jp.Free;
end;
end;