try
Image1.Picture.Graphic := nil;
Image1.Picture.LoadFromFile(jpegfile);
except
on EInvalidGraphic do
Image1.Picture.Graphic := nil;
end;
if Image1.Picture.Graphic is TJPEGImage then
begin
TJPEGImage(Image1.Picture.Graphic).Scale := Self.Scale;
TJPEGImage(Image1.Picture.Graphic).Performance := jpBestSpeed;
end;
|