Snapshot problems

11 messages Options
Embed this post
Permalink
Graham Samuel-4

Snapshot problems

Reply Threaded More More options
Print post
Permalink
I suppose it's just finger trouble, but I'm having great difficulty  
using import snapshot and export snapshot - the RunRev docs seem not  
to be completely specific on this. For example, while apparently I can  
take a snapshot of something that isn't open and isn't visible (the  
docs say so!), I don't seem to be able to take a snapshot of an object  
whose loc is outside the visible area. For example I have an image  
which I've placed out of site at 2000,2000 based on a quite small  
stack, say 800 by 600 pixels. I'm used to this technique for hiding  
stuff from the user, and also for working with objects larger than the  
visible area - in this case, I am doing both of these. Now I want to  
tinker with the image. The statement

import snapshot from rect 1375,2592,1749,2625 of this stack

compiles OK but results in an execution error. Experiments seem to  
show that a statement of the same form restricted to the bounds of the  
stack's window work OK.

What I'm actually trying to do is to create a composite image at  
screen resolution, by overlaying images on top of one another and then  
taking a snapshot of the resultant screen area, but all without the  
user seeing anything. My experiments appear to show that I can do it  
while the various objects are visible (in the visible area) but not  
otherwise. Can anyone explain how this could be done?

TIA

Graham
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Richard Gaskin

Re: Snapshot problems

Reply Threaded More More options
Print post
Permalink
Graham Samuel wrote:

> I suppose it's just finger trouble, but I'm having great difficulty  
> using import snapshot and export snapshot - the RunRev docs seem not  
> to be completely specific on this. For example, while apparently I can  
> take a snapshot of something that isn't open and isn't visible (the  
> docs say so!), I don't seem to be able to take a snapshot of an object  
> whose loc is outside the visible area. For example I have an image  
> which I've placed out of site at 2000,2000 based on a quite small  
> stack, say 800 by 600 pixels. I'm used to this technique for hiding  
> stuff from the user, and also for working with objects larger than the  
> visible area - in this case, I am doing both of these. Now I want to  
> tinker with the image. The statement
>
> import snapshot from rect 1375,2592,1749,2625 of this stack
>
> compiles OK but results in an execution error. Experiments seem to  
> show that a statement of the same form restricted to the bounds of the  
> stack's window work OK.
>
> What I'm actually trying to do is to create a composite image at  
> screen resolution, by overlaying images on top of one another and then  
> taking a snapshot of the resultant screen area, but all without the  
> user seeing anything. My experiments appear to show that I can do it  
> while the various objects are visible (in the visible area) but not  
> otherwise. Can anyone explain how this could be done?

The rect option can be useful at times, but since v2.7 we've had a much
easier and more robust method of exporting images of objects by
specifying the object itself rather than a rect:

   import snapshot from img "MyImage"

The object needn't be an image; it can be anything other than a stack
(referencing the card will work for those), even groups.

The big difference is how the image is generated:

Using the rect option  cips a portion of the display buffer, so if your
image is out of bounds there won't be anything to get.

But using an object reference causes the engine to render the object
into a private buffer for you, much like it would do when rendering the
image on a card, and then hands that buffer back to you in the resulting
image.

In my experience using object references is reliable under a much wider
range of circumstances than using rects, even with objects on cards that
aren't open.

This extension to the snapshot syntax was a by-product of the massive
rendering overhaul Mark Waddingham did for v2.7, and one that's done
wonders here for making screenshots very easily.

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

Re: Snapshot problems

Reply Threaded More More options
Print post
Permalink
In reply to this post by Graham Samuel-4
I forgot to mention another cool feature of using "import snapshot from
<object>":  because it uses the engine's native object rendering scheme
rather than merely clipping the display buffer, it renders with
transparent areas as transparent.

For example, if you import a snapshot of a group of objects, any areas
between the objects are transparent in the resulting image.

Many cool things can be done with this new option, and it's so much
simpler to use than keeping track of rects....

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

Re: Snapshot problems

Reply Threaded More More options
Print post
Permalink
In reply to this post by Graham Samuel-4
Can you lock the screen, place the stack back inside, take the snapshot, and then put the stack outside again?

Craig Newman

On Sep 19, 2009, at 2:57:09 PM, "Graham Samuel" <[hidden email]> wrote:
From:   "Graham Samuel" <[hidden email]>
Subject:    Snapshot problems
Date:   September 19, 2009 2:57:09 PM EDT
To: [hidden email]
I suppose it's just finger trouble, but I'm having great difficulty 
using import snapshot and export snapshot - the RunRev docs seem not 
to be completely specific on this. For example, while apparently I can 
take a snapshot of something that isn't open and isn't visible (the 
docs say so!), I don't seem to be able to take a snapshot of an object 
whose loc is outside the visible area. For example I have an image 
which I've placed out of site at 2000,2000 based on a quite small 
stack, say 800 by 600 pixels. I'm used to this technique for hiding 
stuff from the user, and also for working with objects larger than the 
visible area - in this case, I am doing both of these. Now I want to 
tinker with the image. The statement

import snapshot from rect 1375,2592,1749,2625 of this stack

compiles OK but results in an execution error. Experiments seem to 
show that a statement of the same form restricted to the bounds of the 
stack's window work OK.

What I'm actually trying to do is to create a composite image at 
screen resolution, by overlaying images on top of one another and then 
taking a snapshot of the resultant screen area, but all without the 
user seeing anything. My experiments appear to show that I can do it 
while the various objects are visible (in the visible area) but not 
otherwise. Can anyone explain how this could be done?

TIA

Graham
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Graham Samuel-4

Re: Snapshot problems

Reply Threaded More More options
Print post
Permalink
In reply to this post by Graham Samuel-4
Thanks to all who replied. I think my immediate problem was trying to  
get stuff from a rectangle that extended beyond the actual rendered  
area, as Richard mentions: this causes an 'Execution Error' with no  
further detail, so it's hard to know what has gone wrong - but finger  
trouble, essentially.

However Richard your other point:

> The rect option can be useful at times, but since v2.7 we've had a  
> much
> easier and more robust method of exporting images of objects by
> specifying the object itself rather than a rect:
>
>   import snapshot from img "MyImage"
>
> The object needn't be an image; it can be anything other than a stack
> (referencing the card will work for those), even groups.
>
> The big difference is how the image is generated:
>
> Using the rect option  cips a portion of the display buffer, so if  
> your
> image is out of bounds there won't be anything to get.
>
> But using an object reference causes the engine to render the object
> into a private buffer for you, much like it would do when rendering  
> the
> image on a card, and then hands that buffer back to you in the  
> resulting
> image.
>
> In my experience using object references is reliable under a much  
> wider
> range of circumstances than using rects, even with objects on cards  
> that
> aren't open.
>
> This extension to the snapshot syntax was a by-product of the massive
> rendering overhaul Mark Waddingham did for v2.7, and one that's done
> wonders here for making screenshots very easily.
>
Is not so easy to follow if you're trying to build up a composite  
image: say for the sake of argument one has a picture (an image)  
occupying some part of a card, and one imposes on top of it another  
image, with the intention of snapshotting the combined image so as to  
create a new picture that can be exported: it might be a jpg of a  
membership card with the member's picture imposed on it, or something  
like that. Then if I import a snapshot of my background image (the  
card design), won't  my foreground image (the member's picture) be  
ignored? That's how I read the docs - so what I did in the end was to  
use a rect based on the background image, something like:

import snapshot from rect (the rect of of img "MembershipCard")

This worked, but it appeared to me that I had to have a window (card,  
stack) as big as the whole background image if nothing is to be  
clipped, which was inconvenient.

Anyway I have cracked it, but I don't think the docs tell you all the  
ins and outs - and IMHO there aren't enough examples.

Thanks again

Graham

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Richard Gaskin

Re: Snapshot problems

Reply Threaded More More options
Print post
Permalink
In reply to this post by Graham Samuel-4
Graham Samuel wrote:

 > However Richard your other point:
 >
 >> The rect option can be useful at times, but since v2.7 we've had a
 >> much easier and more robust method of exporting images of objects
 >> by specifying the object itself rather than a rect:
 >>
 >>   import snapshot from img "MyImage"
 >>
 >> The object needn't be an image; it can be anything other than a stack
 >> (referencing the card will work for those), even groups.
 >>
 >> The big difference is how the image is generated:
 >>
 >> Using the rect option  cips a portion of the display buffer, so if
 >> your image is out of bounds there won't be anything to get.
 >>
 >> But using an object reference causes the engine to render the object
 >> into a private buffer for you, much like it would do when rendering
 >> the image on a card, and then hands that buffer back to you in the
 >> resulting image.
...
 > Is not so easy to follow if you're trying to build up a composite
 > image: say for the sake of argument one has a picture (an image)
 > occupying some part of a card, and one imposes on top of it another
 > image, with the intention of snapshotting the combined image so as to
 > create a new picture that can be exported: it might be a jpg of a
 > membership card with the member's picture imposed on it, or something
 > like that. Then if I import a snapshot of my background image (the
 > card design), won't  my foreground image (the member's picture) be
 > ignored? That's how I read the docs - so what I did in the end was to
 > use a rect based on the background image, something like:
 >
 > import snapshot from rect (the rect of of img "MembershipCard")
 >
 > This worked, but it appeared to me that I had to have a window (card,
 > stack) as big as the whole background image if nothing is to be
 > clipped, which was inconvenient.

If you can put the objects you want into a group, this needn't affect
anything in your user experience and requires only small changes to your
script, but would let you use the robust one-liner to get the snapshot
of the group image even if outside of the clipping region of the window:

  import snapshot from grp "MyCompositeThang"

--
  Richard Gaskin
  Fourth World
  Revolution training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Howard Bornstein

Re: Snapshot problems

Reply Threaded More More options
Print post
Permalink
I am trying to do a similar thing. In my case I have some content in a group
that is larger than the group rectangle, so it scrolls within the group.
However, I'd like to be able to take a snapshot of the entire group
contents, even the parts that extend beyond the rectangle (and can only be
seen by scrolling).

I tried your example " import snapshot from grp "MyCompositeThang" but it
only created a picture of the group with its scroll bars, not the entire
internal contents of the group.

Is there an easy way to get this? As I add things to the group, I'd like to
be able to create a complete image of the entire group contents, even the
parts that are not visible within the group rectangle.

--
Regards,

Howard Bornstein
-----------------------
www.designeq.com

On Sun, Sep 20, 2009 at 10:48 AM, Richard Gaskin <[hidden email]
> wrote:

> Graham Samuel wrote:
>
> > However Richard your other point:
> >
> >> The rect option can be useful at times, but since v2.7 we've had a
> >> much easier and more robust method of exporting images of objects
> >> by specifying the object itself rather than a rect:
> >>
> >>   import snapshot from img "MyImage"
> >>
> >> The object needn't be an image; it can be anything other than a stack
> >> (referencing the card will work for those), even groups.
> >>
> >> The big difference is how the image is generated:
> >>
> >> Using the rect option  cips a portion of the display buffer, so if
> >> your image is out of bounds there won't be anything to get.
> >>
> >> But using an object reference causes the engine to render the object
> >> into a private buffer for you, much like it would do when rendering
> >> the image on a card, and then hands that buffer back to you in the
> >> resulting image.
> ...
>
> > Is not so easy to follow if you're trying to build up a composite
> > image: say for the sake of argument one has a picture (an image)
> > occupying some part of a card, and one imposes on top of it another
> > image, with the intention of snapshotting the combined image so as to
> > create a new picture that can be exported: it might be a jpg of a
> > membership card with the member's picture imposed on it, or something
> > like that. Then if I import a snapshot of my background image (the
> > card design), won't  my foreground image (the member's picture) be
> > ignored? That's how I read the docs - so what I did in the end was to
> > use a rect based on the background image, something like:
> >
> > import snapshot from rect (the rect of of img "MembershipCard")
> >
> > This worked, but it appeared to me that I had to have a window (card,
> > stack) as big as the whole background image if nothing is to be
> > clipped, which was inconvenient.
>
> If you can put the objects you want into a group, this needn't affect
> anything in your user experience and requires only small changes to your
> script, but would let you use the robust one-liner to get the snapshot of
> the group image even if outside of the clipping region of the window:
>
>  import snapshot from grp "MyCompositeThang"
>
>
> --
>  Richard Gaskin
>  Fourth World
>  Revolution training and consulting: http://www.fourthworld.com
>  Webzine for Rev developers: http://www.revjournal.com
>
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Richmond Mathewson-2

Re: Snapshot problems

Reply Threaded More More options
Print post
Permalink
Howard Bornstein wrote:

> I am trying to do a similar thing. In my case I have some content in a group
> that is larger than the group rectangle, so it scrolls within the group.
> However, I'd like to be able to take a snapshot of the entire group
> contents, even the parts that extend beyond the rectangle (and can only be
> seen by scrolling).
>
> I tried your example " import snapshot from grp "MyCompositeThang" but it
> only created a picture of the group with its scroll bars, not the entire
> internal contents of the group.
>
> Is there an easy way to get this? As I add things to the group, I'd like to
> be able to create a complete image of the entire group contents, even the
> parts that are not visible within the group rectangle.
>
>  
I doubt it.

You could expand the group for the snapshot and resize it back to its
standard size after the snapshot has been taken.

The only snag is that if your expanded group is bigger than your card
the snapshot won't all be visible.

I would favour EXPORT snapshot, which will send the snapshot off to
your default folder and not mask anything.
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Scott Rossi

Re: Snapshot problems

Reply Threaded More More options
Print post
Permalink
In reply to this post by Howard Bornstein
Recently, Howard Bornstein wrote:

> I am trying to do a similar thing. In my case I have some content in a group
> that is larger than the group rectangle, so it scrolls within the group.
> However, I'd like to be able to take a snapshot of the entire group
> contents, even the parts that extend beyond the rectangle (and can only be
> seen by scrolling).

Here's one way, although it may be a pain for you:

Group the objects within the group, so you wind up with a group within a
group.  Call the inner group "container".  Then script:

 import snapshot from rect (rect of grp "container") of grp "container"

If necessary, you might group when taking a snapshot only, and then ungroup
when completed.  Either way, referencing the container group should work.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Howard Bornstein

Re: Snapshot problems

Reply Threaded More More options
Print post
Permalink
Thanks Scott!

This does work. I sure wish I could wrap my head around *why* it works
however.

Regards,

Howard Bornstein
-----------------------
www.designeq.com

On Fri, Nov 13, 2009 at 12:57 PM, Scott Rossi <[hidden email]>wrote:

> Recently, Howard Bornstein wrote:
>
> > I am trying to do a similar thing. In my case I have some content in a
> group
> > that is larger than the group rectangle, so it scrolls within the group.
> > However, I'd like to be able to take a snapshot of the entire group
> > contents, even the parts that extend beyond the rectangle (and can only
> be
> > seen by scrolling).
>
> Here's one way, although it may be a pain for you:
>
> Group the objects within the group, so you wind up with a group within a
> group.  Call the inner group "container".  Then script:
>
>  import snapshot from rect (rect of grp "container") of grp "container"
>
> If necessary, you might group when taking a snapshot only, and then ungroup
> when completed.  Either way, referencing the container group should work.
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, Multimedia & Design
>
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Scott Rossi

Re: Snapshot problems

Reply Threaded More More options
Print post
Permalink
Recently, Howard Bornstein wrote:

> This does work. I sure wish I could wrap my head around *why* it works
> however.

When it comes to snapshots, you can think of a group as a sheet of glass --
all objects on the glass will be captured in your "photograph", but the
glass (group) itself won't.  In this case, since the snapshot is is targeted
specifically at the container group (the "glass"), the snapshot will only
capture the objects in the group, nothing else.  In the code below, if you
changed the "of grp 'container'" to read "of this cd", the snapshot would
capture everything all the way down to the card level.

Hope this helps.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design



> On Fri, Nov 13, 2009 at 12:57 PM, Scott Rossi <[hidden email]>wrote:
>
>> Recently, Howard Bornstein wrote:
>>
>>> I am trying to do a similar thing. In my case I have some content in a
>> group
>>> that is larger than the group rectangle, so it scrolls within the group.
>>> However, I'd like to be able to take a snapshot of the entire group
>>> contents, even the parts that extend beyond the rectangle (and can only
>> be
>>> seen by scrolling).
>>
>> Here's one way, although it may be a pain for you:
>>
>> Group the objects within the group, so you wind up with a group within a
>> group.  Call the inner group "container".  Then script:
>>
>>  import snapshot from rect (rect of grp "container") of grp "container"
>>
>> If necessary, you might group when taking a snapshot only, and then ungroup
>> when completed.  Either way, referencing the container group should work.


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution