Displaying Images in Rev
J. Landman Gay
jacque at hyperactivesw.com
Thu Feb 24 17:28:14 CST 2011
On 2/24/11 4:06 PM, Tim Ponn wrote:
> Thanks for the idea...but it still doesn't work. I'm thinking maybe
> I'm approaching this from the wrong direction somehow.
Setting the text of an image is the same as "putting" one image into
another, so it fails the same way my original suggestion does. I didn't
realize you just had binary data stored. That does make a difference.
I think your best option is to write the binary to a temporary file on
disk and then load it in as an image reference. There have been some
discussions on how to get the dimensions of an image stored as binary,
but they're all much more difficult than just letting the OS figure it out.
Use the tempname function to get a temporary file name. If you want to
reuse the same file repeatedly so you don't have to worry about deleting
it and making a new one, store the tempname path the first time and just
keep using it over and over, replacing its contents each time.
Off the top of my head (you'll probably need to adjust this) do
something like this:
put the tempname into tTempPath
-- extract your jpg binary data & put into a variable here, then:
put tBinaryJPGData into url ("binfile:"&tTempPath)
set the filename of img 1 to tTempPath
I think that should work. Temp files are removed by the OS at intervals
so if you forget to delete it, it doesn't really matter.
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode