Hi,
I've got a performance issue with loading large(r) jpeg foto's. I want to show a preview of a JPEG image, but the way I'm using now is very slow. In Delphi I can use the "TJpegImage.Scale" option, this is very fast, but I can't find a similar function in Lazarus.
In lazarus 4mb jpg takes +/- 2.5 sec
var
myImage: TBGRABitmap;
begin
myImage := TBGRABitmap.Create;
try
myImage.LoadFromFile('C:\temp\test.jpg'); // 4mb jpg, 2.5sec
myImage.Draw(Image1.Canvas,Rect(0,0,Image1.Width,Image1.Height),False);
finally
myImage.Free;
end;
end;
In Delphi same image takes 140 MilliSec. (almost 20 times faster)
var
AJpg: TJpegImage;
begin
AJpg := TJpegImage.Create;
try
AJpg.LoadFromFile('C:\temp\test.jpg'); //4mb,140millisec
AJpg.Scale := jsEighth;
Image1.Picture.Bitmap.Assign(AJpg);
finally
AJpg.Free;
end;
I've tried a lot of things, browsed almost every web page, but can't find a solution, I hope somebody else does....
Thanks in advance