Página 1 de 1

Saving Images on Database

Publicado: Mié Abr 21, 2010 2:00 am
por Pedro Sousa e Faro
Hi
I need to save an "Image" in a database (MSSQL) field (Type IMAGE)
Anyone knows how to save and retrieve the Image using Xailer ?
best regards
Pedro

Saving Images on Database

Publicado: Mié Abr 21, 2010 1:47 pm
por jfgimenez
Pedro,
> I need to save an "Image" in a database (MSSQL) field (Type IMAGE)
> Anyone knows how to save and retrieve the Image using Xailer ?
To save:
oDataset:Image := ::oImage1:oPicture:SaveToStream()
To load:
::oImage1:oPicture := TPicture():LoadFromStream( oDataset:Image )
However, these methods from TPicture read and write only bmp format. That
is, if your image is a jpeg, it is saved as a bmp.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

Saving Images on Database

Publicado: Mié Abr 21, 2010 1:47 pm
por jfgimenez
Pedro,
> I need to save an "Image" in a database (MSSQL) field (Type IMAGE)
> Anyone knows how to save and retrieve the Image using Xailer ?
To save:
oDataset:Image := ::oImage1:oPicture:SaveToStream()
To load:
::oImage1:oPicture := TPicture():LoadFromStream( oDataset:Image )
However, these methods from TPicture read and write only bmp format. That
is, if your image is a jpeg, it is saved as a bmp.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info