Snapshot problems

Howard Bornstein howard.bornstein at gmail.com
Fri Nov 13 14:22:06 CST 2009


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 <ambassador at fourthworld.com
> 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
>



More information about the use-livecode mailing list