Hi there,
I am using the code shown below to fill a NexusDB Table connected to a DevExpress QuantumGrid - CardView.
Scrolling through the Grid executes at an amazing speed (Picasa / Lightroom 5 compatible).
However scrolling slows down significantly at some records. Looking more closely at these records I noticed that they were all jpegs without an EXIF_Bitmap.
So for these records the second part of the code is executed. To check their actual size I saved the Image directly from the CardView to disc. These images were much larger then one would expect from a 160X160 pixel image.
I am quite sure that the code is correct. So I am suspecting that the scaling and loading do not work correctly as they should.
try
if Assigned(ImageViewer_1.IO.Params.EXIF_Bitmap) then
begin
//Load just the EXIF_Bitmap into ImageEnView1
ImageViewer_1.IO.Params.GetThumbnail := True;
ImageViewer_1.IO.LoadFromFile(aFile);
end
else
//If Not EXIF-Thumb exists then read reduced size of original Picture
begin
ImageViewer_1.IO.Params.Width := 160;
ImageViewer_1.IO.Params.Height := 160;
ImageViewer_1.IO.Params.JPEG_Scale := ioJPEG_AUTOCALC;
// ImageViewer_1.IO.Params.JPEG_DCTMethod := ioJPEG_IFAST;
ImageViewer_1.IO.Params.EnableAdjustOrientation := True;
ImageViewer_1.IO.LoadFromFile(aFile);
end;
finally
Field := TBlobField(tPictures.FieldByName('Thumb'));
Stream := tPictures.CreateBlobStream(Field, bmWrite);
ImageViewer_1.IO.SaveToStream(Stream,ioJPEG);
ImageViewer_1.IO.CloseMediaFile;
Stream.Free;
end;