Board index » delphi » How to store jpeg pictures in paradox db

How to store jpeg pictures in paradox db

I have a problem when I try to open/store jpeg graphicsfiles in a
paradox graphics field.

Im able to open the file if I define a TImage field that I use, but
when I try to set the TDBImage.Picture to the value of the
TImage.Picture I get an error indicating that TJPEGImages can't be
stored in a TImage!

If I try to load the picture with the LoadFromFile method in the
TGraphicField component I get the same error.

I have included jpeg in my uses but is there anything else I should do
or is this a dead end?

-
:Henrik Lynnerup
:Lynnerup Data
:lynne...@post9.tele.dk

 

Re:How to store jpeg pictures in paradox db


Quote
Henrik Lynnerup wrote:

> I have a problem when I try to open/store jpeg graphicsfiles in a
> paradox graphics field.

And this is already the problem...

Quote
> If I try to load the picture with the LoadFromFile method in the
> TGraphicField component I get the same error.

Problem is that the graphics field of a Paradox database ONLY
understands BMP images, if you want to store images in any other format
you need to use a plain binary field (TBlobField in delphi). Then you
can use the TBlobStream to read/write the data from/to the database and
the JPEG image. This works with the freeware TJPEGImage (from Luciano
Bajo Eloy and myself) without problems, but I think it'll work with the
D3 JPEG image, too.

Bye,
   Andy

http://www.westend.de/~hoerstemeier

Re:How to store jpeg pictures in paradox db


On Fri, 05 Dec 1997 09:52:40 +0100, Andreas Hoerstemeier <a...@scp.de>
wrote:

Quote
>Problem is that the graphics field of a Paradox database ONLY
>understands BMP images, if you want to store images in any other format
>you need to use a plain binary field (TBlobField in delphi). Then you
>can use the TBlobStream to read/write the data from/to the database and
>the JPEG image. This works with the freeware TJPEGImage (from Luciano
>Bajo Eloy and myself) without problems, but I think it'll work with the
>D3 JPEG image, too.

I've tried what you suggested but it seems that I've missed something
so if you have a small template or similar that would show how to read
a jpeg file (and perhaps bmp too) and put it in a paradox field, I
would be happy!

-
:Lynnerup Data
:Henrik Lynnerup
:lynnerup_at_post9.tele.dk
:(please replace _at_ with @ before email)

Other Threads