In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Saving Images on Database

Xailer professional forum in English
Responder
Pedro Sousa e Faro
Mensajes: 91
Registrado: Mié May 30, 2007 5:25 pm

Saving Images on Database

Mensaje 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
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Saving Images on Database

Mensaje 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
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Saving Images on Database

Mensaje 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
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Responder