How I can show image on stack by script and insert or update or delete or select image on stack into Database?

Ken Ray kray at sonsothunder.com
Wed Apr 5 15:17:29 EDT 2006


On 4/3/06 1:48 AM, "supote.songthammawat" <supote.songthammawat at gmail.com>
wrote:

> Hi everybody
> 
>       Why I can't to show image on stack by script? I want to know
> syntax  that use  to show image?

Well, to display an image, you create an image object and then set the
'filename' property to the path to the image on disk. Something like:

  set the filename of img "MyImage" to "/Users/kenray/pix/face.jpg"

> In addition, how to insert or update or
> delete  image on stack into Database(Sybase) and select image from
> Database(Sybase) to show on object of stack (SQL) ? Please suggest me.

Well, this one I've not done, but I assume you'd use a BLOB field for
holding the image data, and then use the DB commands to set the value of the
field in the database to the 'imageData' property of the image. Then when
you want to get the image from the DB, you request the BLOB data (I'm
assuming it's put into a varaible called "tData") and do:

  set the imageData of img "MyImage" to tData

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list