How to save jpg image to database and then load it in Delphi using FIBplus and TImage?
views:
3231answers:
3
A:
Take a look here. I think you have to convert it to a stream, store it and vice versa.
Roger Ween
2008-09-15 12:08:55
A:
This page explains it. Use SaveToStream and a TMemoryStream instead of SaveToFile if you don't want temporary files. TImage.Picture has a LoadFromStream which loads the image from the stream into the TImage for display.
Lars Truijens
2008-09-15 19:15:12
+2
A:
var
S : TMemoryStream;
begin
S := TMemoryStream.Create;
try
TBlobField(AdoQuery1.FieldByName('ImageField')).SaveToStream(S);
S.Position := 0;
Image1.Picture.Graphic.LoadFromStream(S);
finally
S.Free;
end;
end;
if you are using JPEG images, add JPG unit to uses clause of your unit file.
Ali
2008-09-16 03:49:15