jacque wrote: Mon Sep 27, 2021 7:10 am
BTW, the "of this card" isn't necessary. Object references are only needed if you want the whole object snapshotted. (And cards aren't objects, really.)
export snapshot from rectangle snapshotRectangle to image id imageIdNumber
Hi Jacque,
This is not clear to me from the LiveCode dictionary:
If a window, stack or object is specified, the rectangle is given in relative (window) coordinates; otherwise, it is given in absolute coordinates.
I'm not specifying the image in the command, so I presumed I needed "of this card" to have the command interpret the coordinates as relative rather than absolute.
Cheers!
Rob Cozens dba Serendipity Software Company
Manchester, CA USA
Each new generation gives more attention to the man-made world...
and less attention to the world that made man.
The result sounds the same, but the bug report focuses on "export snapshot from image ..." which has been fixed according to Richmond.
My issue results from "export snapshot from rectangle ...". My guess is it's the same issue but the bug fix only corrected it in "export from image". Since "export from image" looks only at the specified image and disregards any other objects in the rectangle, while "export from rectangle" looks at all the pixels in the rectangle, it seems reasonable to believe the fix for one would not necessarily fix both.
I'm running v9.6.2 on a 64 bit Windows platform>
Cheers!
Rob Cozens dba Serendipity Software Company
Manchester, CA USA
Each new generation gives more attention to the man-made world...
and less attention to the world that made man.
put "GIF" into imageType
export snapshot from rectangle snapshotRectangle of this card to image id imageIdNumber as imageType
export snapshot from rectangle snapshotRectangle of this card to image id imageIdNumber as "GIF"
export snapshot from rectangle snapshotRectangle of this card to image id imageIdNumber as GIF
Since LiveCode allows so many references to be resolved at runtime, I have to wonder whether this syntax is not supported because of an oversight or because of something intrinsic in the Script Editor or the export snapshot command.
I would prefer to resolve image type at runtime rather than script a four-case switch.
Rob Cozens dba Serendipity Software Company
Manchester, CA USA
Each new generation gives more attention to the man-made world...
and less attention to the world that made man.
Klaus wrote: Tue Sep 28, 2021 6:53 pm
In the first two lines you try to use the STRING "Gif" as the format, but obviously LC does not like that.
That is the essence of my question Klaus: Why can't LiveCode resolve the "as type" argument at runtime? I have the workaround in the form of a switch, but wonder if there is a specific reason why "as type" can't be resolved at runtime when so many other command arguments can be.
Not a big issue; just an idle wondering.
Rob Cozens dba Serendipity Software Company
Manchester, CA USA
Each new generation gives more attention to the man-made world...
and less attention to the world that made man.