I’m using this code to load images into my Timage:
begin
if OpenPictureDialog1.Execute(Self.Handle) then
Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
end;
Then I’m using this code to store into my ms access database:
var
AStream : TMemoryStream;
begin
Adotable1.Append;
AStream := TMemoryStream.Create;
try
Image1.Picture.Graphic.SaveToStream(AStream);
AStream.Position := 0;
if Adotable1.Active then
begin
TBlobField(Adotable1.FieldByName('Termograma')).LoadFromStream(AStream);
end;
finally
AStream.Free;
end;
adotable1.Post;
But now I want to display these saved images on a Timage, can anyone help me?
The images are .jpeg format
As far as TPicture is not able to decide which kind of TGraphic it has to create for loading, since a stream does not have an extension like a filename you have to decide it, and assign the Graphic.
In this case a TJPEGImage to the Picture.
The following unit is able to store diffent graphicformats in blobfields.
Storage is not compatible to simple storing of image data because information about then graphicformat is stored too, to give the ability to create the needed class for loading.