¿Cómo se guardan y leen imágenes en Delphi XE7?

¿Cómo se guardan y leen imágenes desde una base de datos de Firebird en Delphi XE7 con FireDAC en una aplicación con FireMonkey (o Multi-Device como han renombrado ahora)?

Utilizo el Livebindings y el siguiente código

var
    Field : TBlobField ;
    Stream : TStream ;
begin
  if  Tfotos.Active and ( ImgFoto.Bitmap <> nil ) then
  begin
      Tfotos.Insert ;
      Field := TBlobField ( Tfotos.FieldByName('Foto'));
      Stream := Tfotos.CreateBlobStream ( Field , bmWrite );
      try
          ImgFoto.Bitmap.SaveToStream ( Stream );
     finally
         Stream . Free ;
         Tfotos.Post ;
    end ;

  end;

end;

Añade tu respuesta

Haz clic para o