Print Thread
How can I read a BLOB into a TPicture with a stream ?
#9926 07/22/08 09:41 PM
Joined: May 2001
Posts: 14
Remscheid, GERMANY
T
Member
OP Offline
Member
T
Joined: May 2001
Posts: 14
Remscheid, GERMANY
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

Re: How can I read a BLOB into a TPicture with a stream ?
#9927 07/23/08 03:49 PM
Joined: Aug 1999
Posts: 22,214
Member
Offline
Member
Joined: Aug 1999
Posts: 22,214
A TLOBLocator is a TStream descendant, so my guess would be:

Pic.Graphic.LoadFromStream(LOB);


Marco Kalter
Allround Automations
Re: How can I read a BLOB into a TPicture with a stream ?
#9928 07/23/08 08:20 PM
Joined: May 2001
Posts: 14
Remscheid, GERMANY
T
Member
OP Offline
Member
T
Joined: May 2001
Posts: 14
Remscheid, GERMANY
Sometimes things are so simple ...

Thanks for your help.

Thomas

Re: How can I read a BLOB into a TPicture with a stream ?
Thomas Reppel #58159 07/17/18 01:45 PM
Joined: Mar 2000
Posts: 8
Herdecke, NRW, Germany
S
Member
Offline
Member
S
Joined: Mar 2000
Posts: 8
Herdecke, NRW, Germany
Hi,

have you also a solution for selecting a blob field into TPicture using TOracleDataSet?

Best regards
Rolf


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.032s Queries: 15 (0.008s) Memory: 2.5106 MB (Peak: 3.0395 MB) Data Comp: Off Server Time: 2024-05-10 07:42:45 UTC
Valid HTML 5 and Valid CSS