Board index » delphi » Retrive an Image from a Paradox DB

Retrive an Image from a Paradox DB

I have A Table with store some Picture in Bitmap format.
I want to Print this image without using tools such ReportSmith.
How can I store the image from the database to a TBitmap?
Thanks.
roberto.colp...@galactica.it
 

Re:Retrive an Image from a Paradox DB


On Sun, 9 Jan 2000 00:02:46 +0100, "Roberto.Colpani"

Quote
<roberto.colp...@isdn.galactica.it> wrote:
>I have A Table with store some Picture in Bitmap format.
>I want to Print this image without using tools such ReportSmith.
>How can I store the image from the database to a TBitmap?

One way would be to instantiate your TBitmap object and then use its Assign
method to copy from BLOB column to the object. Specify a TBlobField object
representing the BLOB column as the argument for the Assign method.

  var
    b: TBitmap;
  begin
    b := TBitmap.Create;
    try
      b.Assign(Table1Image);
    finally
      if Assigned(b) then b.Free;
    end;
  end;

If you are not using persistent field objects, the Assign command line
might look more like this:

      b.Assign((Table1.FieldByName('Image') as TBlobField));

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Steve Koterski              "Health nuts are going to feel stupid someday,
Felton, CA                  lying in hospitals dying of nothing."
                                                              -- Redd Foxx

Other Threads