Converting a PicHandle to format for use with imageData
Dar Scott
dsc at swcp.com
Mon Dec 29 15:57:15 EST 2003
On Monday, December 29, 2003, at 12:30 PM, Trevor DeVore wrote:
> This is fairly new territory for me so I'm not quite sure how you
> would copy the PixMap of the GWorld to the imageData of the image
> object.
I'm no expert either.
Here is the PixMap data:
http://developer.apple.com/documentation/QuickTime/APIREF/SOURCESIV/
pixmap.htm#//apple_ref/c/tag/PixMap
I would guess you would use that info to calculate the rectangle
property and that & the associated bitmap (and maybe color table) to
calculate the imageData property of the image. (I'm guessing that
maskData and alphaData would not need to be set.)
The imageData is described in the Transcript Dictionary.
However... I have used 'export snapshot' to put a snapshot into a
variable as PNG and then stuffed that value into the text property of
an image. I don't know if the value put into the variable is exactly
PNG, but I suspect it might be. It might be that PNG is the only type
that the text property can be set to, but I think it worth trying
others such as JPEG. So, if you can create a ram image of some file
format, your external might return that and maybe that will work as the
text property of an image. The experimenting might be worth it if the
above conversion is to be avoided.
(Caveat: Some of my image code broke in a recent Rev version. I'm not
sure if it is export snapshot, buffering properties, lock/unlock screen
or what, so watch out.)
Hmmm. Can you move to that frame and then export snapshot? Or is that
too ugly?
Dar Scott
More information about the use-livecode
mailing list