views:

3231

answers:

3

How to save jpg image to database and then load it in Delphi using FIBplus and TImage?

A: 

Take a look here. I think you have to convert it to a stream, store it and vice versa.

Roger Ween
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
+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