Re: Add example to dictionary (was Re: Help on export snapshot)

2009-06-12 Thread Richard Gaskin

Mark Schonewille wrote:


on mouseUp
put "~/desktop/test.png" into myFile
if there is a file myFile then delete file myFile
set the filetype to "PNGf"
export snapshot from rect (the rect of this stack) to file myFile
as PNG
end mouseUp


The "from rect" option will grab a portion of the rendered image from 
the display device buffer, which will include portions of any other 
window which may overlap.


For a true WYSIWYG grab that may be exactly what's needed, but if you 
want to grab only a specific window, or even an object within that 
window, without anything else in the image, you can use the "export from 
" form introduced in v2.7.


Oddly enough, stacks cannot be used as the referenced object, so this 
won't work:


  export snapshot from this stack to file myFile

But cards can, so this will work:

  export snapshot from this cd of this stack to file myFile

With v2.7 Mark Waddingham did a massive overhaul to the way objects are 
rendered in order to better accommodate modern OS buffering schemes 
along with antialiasing and more, and thankfully implemented it in a way 
that exposes those buffers to us with this new option for "export snapshot".


The engine still supports the grab from the general display buffer by 
specifying a rect, which will then grab it from the OSes master display 
which includes all windows.


But if you need to render just a specific object, you can trigger Rev's 
internal buffering routines to create a buffer into which it will render 
that for you and hand you the resulting image data, using the "...from 
" option.


Which is better will of course depend on what you want to do.  But it 
can be handy for Paul to know both forms to pick the one that works best 
for what's needed.  His original attempt at using "this window" was very 
close; just changing that to "this cd of this stack" should do what he 
was looking for.


--
 Richard Gaskin
 Fourth World
 Revolution training and consulting: http://www.fourthworld.com
 Webzine for Rev developers: http://www.revjournal.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Add example to dictionary (was Re: Help on export snapshot)

2009-06-12 Thread Devin Asay


On Jun 11, 2009, at 7:58 PM, J. Landman Gay wrote:


Mark Schonewille wrote:

Hi Paul,

This will work:

on mouseUp
put "~/desktop/test.png" into myFile
if there is a file myFile then delete file myFile
set the filetype to "PNGf"
export snapshot from rect (the rect of this stack) to file myFile
as PNG
end mouseUp


Or to be cross-platform:

put specialFolderpath("desktop") & "/test.png" into myFile



There are lots of great, short scripting examples, like this one, that  
show up here on the list. My I suggest that whenever you submit one  
you also consider submitting it as a User Note to the appropriate  
dictionary entry in Rev 3.5. It is real-world examples like this that  
are lacking in many dictionary entries, and they would make the  
dictionary a much more valuable tool.


In this particular example, I remember the first time I used export  
snapshot. It took me quite a bit of fiddling and searching the list  
archives until I finally got it. This script would have clarified it  
for me in a fraction of the time.


Regards,

Devin

P.S. Mark and Jacque, with your permission, I'll be happy to submit  
your combined example.


Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Help on export snapshot

2009-06-11 Thread J. Landman Gay

Mark Schonewille wrote:

Hi Paul,

This will work:

on mouseUp
 put "~/desktop/test.png" into myFile
 if there is a file myFile then delete file myFile
 set the filetype to "PNGf"
 export snapshot from rect (the rect of this stack) to file myFile 
as PNG

end mouseUp


Or to be cross-platform:

put specialFolderpath("desktop") & "/test.png" into myFile

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Help on export snapshot

2009-06-11 Thread Paul Gabel

Hi Mark:

This works beautifully. I never would have figured it out. Thank you  
very much.


Paul Gabel
---
On Jun 11, 2009, at 3:10 PM, Mark Schonewille wrote:


Hi Paul,

This will work:

on mouseUp
put "~/desktop/test.png" into myFile
if there is a file myFile then delete file myFile
set the filetype to "PNGf"
export snapshot from rect (the rect of this stack) to file  
myFile as PNG

end mouseUp

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
Snapper Screen Recorder 2.0.1 http://snapper.economy-x-talk.com

If you sent me an e-mail before 15 May and haven't got a reply yet,  
please send me a reminder.




On 11 jun 2009, at 22:49, Paul Gabel wrote:


Hello list:

Can anyone help me on exporting a snapshot by script. I have a  
little camera image that, when clicked, should export a snapshot of  
the card/window to the desktop of any user. I've read the export  
snapshot docs, but I'm having trouble with a universal filepath to  
the desktop.


export snapshot from this window to file "/HD/Users/Desktop.jpg" as  
JPEG


doesn't function.

export snapshot to file "experiment.png"

results in a garbled text in a Text Edit file buried in my Rev 3.5  
folder.


Mac 10.5.8
Rev 3.5 gm 2

Thank you very much,

Paul Gabel



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Help on export snapshot

2009-06-11 Thread Mark Schonewille

Hi Paul,

This will work:

on mouseUp
 put "~/desktop/test.png" into myFile
 if there is a file myFile then delete file myFile
 set the filetype to "PNGf"
 export snapshot from rect (the rect of this stack) to file  
myFile as PNG

end mouseUp

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
Snapper Screen Recorder 2.0.1 http://snapper.economy-x-talk.com

If you sent me an e-mail before 15 May and haven't got a reply yet,  
please send me a reminder.




On 11 jun 2009, at 22:49, Paul Gabel wrote:


Hello list:

Can anyone help me on exporting a snapshot by script. I have a  
little camera image that, when clicked, should export a snapshot of  
the card/window to the desktop of any user. I've read the export  
snapshot docs, but I'm having trouble with a universal filepath to  
the desktop.


export snapshot from this window to file "/HD/Users/Desktop.jpg" as  
JPEG


doesn't function.

export snapshot to file "experiment.png"

results in a garbled text in a Text Edit file buried in my Rev 3.5  
folder.


Mac 10.5.8
Rev 3.5 gm 2

Thank you very much,

Paul Gabel



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Help on export snapshot

2009-06-11 Thread Richmond Mathewson

2 problems as far as I can see:

1. You need to fiddle around with  set default folder

e.g:

set the defaultFolder to /HD/Users

2. export snapshot to file "experiment.png" as PNG  (i.e. not as 
scrambled eggs)



Paul Gabel wrote:

Hello list:

Can anyone help me on exporting a snapshot by script. I have a little 
camera image that, when clicked, should export a snapshot of the 
card/window to the desktop of any user. I've read the export snapshot 
docs, but I'm having trouble with a universal filepath to the desktop.


export snapshot from this window to file "/HD/Users/Desktop.jpg" as JPEG

doesn't function.

export snapshot to file "experiment.png"

results in a garbled text in a Text Edit file buried in my Rev 3.5 
folder.


Mac 10.5.8
Rev 3.5 gm 2

Thank you very much,

Paul Gabel
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Help on export snapshot

2009-06-11 Thread Paul Gabel

Hello list:

Can anyone help me on exporting a snapshot by script. I have a little  
camera image that, when clicked, should export a snapshot of the card/ 
window to the desktop of any user. I've read the export snapshot docs,  
but I'm having trouble with a universal filepath to the desktop.


export snapshot from this window to file "/HD/Users/Desktop.jpg" as JPEG

doesn't function.

export snapshot to file "experiment.png"

results in a garbled text in a Text Edit file buried in my Rev 3.5  
folder.


Mac 10.5.8
Rev 3.5 gm 2

Thank you very much,

Paul Gabel
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution