How can I read a BLOB into a TPicture with a stream ?

Hello,

I try to read a blob field into a TPicture component but at a certain point my ideas are a its end... :confused:


Code:
With myquery DO
    Begin
      Close;
      DeleteVariables;
      SQL.Clear;
      SQL.Add ('Select mypic from mytable ');
      SQL.Add ('Where ID = :ID ');
      DeclareVariable('ID', otInteger);
      SetVariable('ID',myID);
      try
        Execute;
        If RowCount = 0 THEN Exit;
        LOB := LOBField('mypic');
        if not LOB.IsNull
          then
            begin

               ???

              Stream := TMemoryStream.Create;
              Stream.Position := 0;
              Pic.Graphic.LoadFromStream(Stream);
            end;
        Close;
      except
         on e: exception do
           begin
            showMessage(e.Message);
            Close;
           end;
      end;
   end;
Can you please give my a hint ?

Thanks

Thomas
 
Back
Top