On Tue, 2007-05-15 at 13:15 +0200, A.J. Venter 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 ?
If you have a blob-field, you can access it directly using a stream. (It's even the fastest way - all other methods will also create a stream, and convert it from there) So no need for any string-conversions. Just use: TImage.LoadFromStream(Dataset.CreateBlobStream(Field,bmread)); But why don't you use a TDBImage? Joost. _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives