I am trying to show a previously saved image in a blob field with Delphi's TImageViewer
component. I am developing with Delphi 10.1 Berlin.
The image does not fit in the TImageViewer
component, even using the BestFit
command, as shown below. The image is bigger than the component. But it fits in the component if the image does not come from a database field.
Here is my code:
BlobStream := qryFoto.CreateBlobStream(qryFoto.FieldByName('image'), TBlobStreamMode.bmRead);
Image1.Bitmap.LoadFromStream(BlobStream);
Image1.BestFit;
BlobStream.Free;
How to fit it?