Hi,

You are looking for blob. I recommand you to store the image a base64
on a text blob rathet then a binary blob.
The reason is simple.. backup and restore of data.

Ido

On 5/15/07, A.J. Venter <[EMAIL PROTECTED]> wrote:
Hi all,
I would like to be able to store images inside a postgresql table
(inserted WITH a lazarus app) then retrieve them again and display
them from inside a different lazarus app.
XPM would do, but jpg would be ideal.

I am guessing the process would be something like this:

Inserting an image:
Use a TImageSelect dialog to select the filename
Load the file into a TStringList;
SQL Insert TStringlist.Strings
(Easiest way to get from file to string)
What would be the best SQL type to store it as ? BLOB ?

Retrieving:
SQL Select Image
Read the result into a string
Store the string into a Tmemorystream
TImage.LoadFromSTream(TMemoryStream)

This brings up a few questions though:
1) How can I store a string into a TMemoryStream ? I know that
TStringList has a loadFromStream method - but how d I go the other way
around ?

Is there a BETTER way I should using ?

A.J.

--
A.J. Venter
CEO - OutKast Solutions C.C.
http://www.outkastsolutions.co.za
Cell: +27 83 455 9978
Fax: +27 21 413 2800
Office: +27 21 591 6766

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives



--
http://ik.homelinux.org/

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to