Board index » delphi » Using TImage to read/write bitmaps from Oracle

Using TImage to read/write bitmaps from Oracle

Quote
Andr Lang (andre.l...@hec.unil.ch) wrote:

: I am actually using delphi to query an oracle database by
: accessing it directly through ODBC. As I don't use the Database
: Component from delphi I was wondering how I could
: display in a TImage the images contained in the oracle database.
So you want to assign the contents of a binary field to a TImage? If so you
just have to create a TBlobStream and then use the LoadFromStream method of
the TImage, the code might look like this:

var BS:TBlobStream;

try
   BS := TBlobStream.Create(Table1BinaryField1,bmread);
   Image1.LoadFromStream(BS);
finally
   BS.free;
end;

Hope that helps,
     Andy

--
----------------------------------------------------------------------------
Andreas H"orstemeier                       | This Signature is Shareware
email: hoer...@hal1.physik.uni-dortmund.de |
       a...@farpoint.sauerland.de          | Please pay $10 to read
fido:     2:2444/4505.3                    |
astronet: 122/490/1.53                     |
----------------------------------------------------------------------------  

 

Re:Using TImage to read/write bitmaps from Oracle


I am actually using delphi to query an oracle database by
accessing it directly through ODBC. As I don't use the Database
Component from delphi I was wondering how I could
display in a TImage the images contained in the oracle database.

Tahnk you in advance for any help.

Other Threads