//试一试
uses
JPEG;begin
with TJPEGIamge.Crate(Self) do try
Picture.Assign(Iamge1.Picture);
Picture.SaveToFile('D:\1.jpg');
finally
Free;
end;
end;
uses
JPEG;begin
with TJPEGIamge.Crate(Self) do try
Picture.Assign(Iamge1.Picture);
Picture.SaveToFile('D:\1.jpg');
finally
Free;
end;
end;
// ~~~~笔误
MyJpeg: TJpegImage;
Image1: TImage;
begin
Image1:= TImage.Create(self);
MyJpeg:= TJpegImage.Create;
Image1.Picture.Bitmap.LoadFromFile('c:\windows\desktop\aa.BMP'); // Load the Bitmap from a file
MyJpeg.Assign(Image1.Picture.Bitmap); // Assign the BitMap to MyJpeg object
MyJpeg.CompressionQuality:=StrToInt('75');
MyJpeg.Compress;
MyJpeg.SaveToFile('c:\windows\desktop\test.JPG'); // Save the JPEG to Disk
end;