Page 1 of 1
"export snapshot" syntax
Posted: Sun Dec 24, 2006 3:29 pm
by xApple
Hello everyone !
I was a little confused on how to use the "export snapshot" command...
In the documentation you can read this:
export snapshot [from rect[angle] rectangle] [of object] to {file filePath |container} [as format] [with mask maskFile]
The "from rect" form works quite well, but I was intrested in implementing the "of object" form... only my script never seams to compile.
I just want to take a screenshot of my main stack window, whatever size it is and where ever it is on the screen...
Code: Select all
export snapshot of window (the mainstack of this stack) to file pictPath as PNG
export snapshot of stack (the mainstack of this stack) to file pictPath as PNG
doesn't compile : (
Re: "export snapshot" syntax
Posted: Tue Dec 26, 2006 12:18 pm
by marielle
xApple wrote:Code: Select all
export snapshot of window (the mainstack of this stack) to file pictPath as PNG
There is a gotcha. What follows window in this context is a window ID. Then the coordinates will be relative to that window.
Code: Select all
export snapshot from rect (the rect of this card) of window (the windowid of this stack) to file "myimage.png" as png
With stack, the syntax is as folllows. The coordinates are then relative to the screen rectangle. Any window that overlaps with the snapshot will be included in the snapshot.
Code: Select all
export snapshot from rect (the rect of this stack) to file "myimage.png" as png
Posted: Sat Jan 13, 2007 10:53 pm
by xApple
Hey thanks a bunch
Problem with export snapshot
Posted: Fri Apr 27, 2007 9:37 am
by alessandropisoni
i use this syntax : export snapshot from rect (the rect of this card) of window (the windowid of this stack) to file "Grafico.jpg" as jpeg
but if the windows card is 500x600 pixel export only the background nobody object why?
if the windows card is 200x150 pixel export is ok ? why this!!
Re: Problem with export snapshot
Posted: Fri Apr 27, 2007 11:45 am
by marielle
I have a vague memory of issues with very big images but I couldn't track it down in the
quality center
Posted: Fri Apr 27, 2007 6:02 pm
by xApple
With the latest 2.8 I've had problems exporting snapshots when the rectangle was of a certain size and located on my second screen. It would cause an execution error : (
Re: Problem with export snapshot
Posted: Sat Apr 28, 2007 9:44 pm
by marielle
alessandropisoni wrote:(private email) my problem is first image only background!!!! second image is correct!
this is my code:
..........
Code: Select all
go card"Grafico" of stack"Grafico"
export snapshot from rect (the rect of this card) of window (the windowid of this stack) to file "Grafico.jpg" as jpeg
Hi Alessandro,
Allow me to reply here, as this may be of interest to others. The problem is possibly that the snapshot is being taken before the card content is fully loaded.
You may want to add
wait 10 tick (or whatever works) before export snapshot. Something else to try is to use a dummy instruction that requires access to all controls on the cards, like
put the number of controls of this card into myVar.
Problem resolved in part
Posted: Wed May 02, 2007 3:01 pm
by alessandropisoni
Problem resolved in part. Inserting a answer box before export
snapshot the image it comes saved correctly!
The strange thing is that in debug the instruction it works also
without answer box. The problem only appears when the application is
compiled!!!
Re: Problem resolved in part
Posted: Wed May 02, 2007 3:12 pm
by marielle
alessandropisoni wrote:Problem resolved in part. Inserting a answer box before export snapshot the image it comes saved correctly!
Thanks for these additional information. Answer box... then this reminds me of a similar problem I got a while ago. With an answer box, I could get the screen refreshed in time for the snapshot. Without the answer box, the snapshot was taken before the screen got refreshed.
Using anything else, like wait for 10 ticks or whatever other on screen event didn't work. Only the answer box made the trick.
Because an answer box was not appropriate in the application, I completely reorganized my code to have the behavior I wanted. I couldn't understand however the source of the problem (not enough to enter a bug). Do you have a short demo stack associated with this you could make available?
Like making present this anomaly
Posted: Thu May 03, 2007 8:04 am
by alessandropisoni
Also to a my friend who develops in Revolution it succeeds the same
thing and it must force the program with a answer box! How never
nobody has informed the producers of the software of this anomaly? It
would be comfortable to have a commando tipo"Refresh card"!!!
new problem with exportsnapshot
Posted: Wed May 09, 2007 6:06 pm
by alessandropisoni
I have found an other problem with exportsnapshot under windows.
Putting answer box before the command export the image that saves it
has over the answer box. In practical it does not wait for that I
confirmations the box but execute of continuation the instruction
export. This only with windows with Mac the image comes exported
after that I have to confermed the key in the answer box.
It would have be see again exportsnapshot
bye
Posted: Wed May 09, 2007 9:03 pm
by Klaus
Qucik and maybe naive question:
Does a "lock screen" and "unlock screen" not what you want (Refresh card)?
Regards
Klaus
Posted: Tue Apr 08, 2008 5:16 am
by alex298
Hi,
The following works great if I wish to print out the whole card.
Code: Select all
export snapshot from rect (the rect of this card) of window (the windowid of this stack) to file "Grafico.jpg" as jpeg
What is the syntax if I wish to print part of the card? For example:
1. from left co-ordinate (x1, y1) of this card to the rest of this card
2. from left co-ordinate (x1, y1) of this card to the right co-ordinate (x2, y2) of this card
Thanks and best regards