Subject Re: [firebird-support] Sample Delphi code?
Author Jonathan Neve
Hi Myles,

Myles Wakeham wrote:

>I have to store some images in a Delphi 7 application I'm designing, using
>FIBPlus, and was wondering if anyone could point me in the right direction
>for some example code on handling the storing of images from Delphi into
>BLOBs in Firebird?
>
>
I've done that kind of thing on several occasions, also using FIBPlus.
The actual code for storing the image depends largely on where you've
got it to begin with. I'll assume you're using some sort of TImage
descendant.

All you really need to do is:

Image.SaveToFile('File.tmp');
BlobField.LoadFromFile('File.tmp');

You could also use LoadFromStream, but personnaly, I've always had a bit
of trouble getting this to work, so I always use a temp file.

I made myself a simple little routine for resampling a bitmap,
converting it to jpeg, and saving it to a blobfield (using MWA Jpeg
library). If you're interested, I could send it to you, though it really
isn't very complicated. If you just want to store the image as-is, it's
even simpler of course.

--
Best regards,
Jonathan Neve
_______________
CopyTiger - advanced database replicator for Interbase/Firebird!
Web : http://www.microtec.fr/copycat/ct
_______________________________________
CopyCat - database replication components for Delphi/C++Builder!
Web : http://www.microtec.fr/copycat/cc