Import from rect

Ken Ray kray at sonsothunder.com
Sun Jan 18 16:00:07 EST 2009


> Actually at first I thought this was a bug, but it makes a bit of
> sense. The rect and I guess grouping the objects will force a visible
> or visual snapshot of where the object physically resides including
> objects beneath that show through the alpha mask but using the actual
> object must allow the engine to reference the object itself
> programatically so it is not 'seeing' the alpha or better yet it is
> not seeing through the alpha to the objects underneath.
> 
> As Richard said " "export snapshot" which allows you to specify the
> object rather than merely its rect:" "This will cause the object
> specified to be rendered into an offscreen buffer directly, then that
> buffer is compressed into the specified format for writing to disk."
> 
> It must be the ability to render offscreen in the buffer that is the
> difference here. This must be the case with the import snapshot as well.

Right... I've been playing around with this myself. Basically (if I
understand this properly), you have the following options:

(NOTE:  I'm using a red filled square graphic ("grc 1") in the upper-left
corner of my card that is at a 70% blend, overlapped by a black filled
rectangle graphic)

1) SCREENSHOT: 
       - Gets an image of the region of an object
       - Image includes overlapping objects on the card and
            overlapping windows from Rev or any other program
       - Dumps the image at the center of the current card ("import"),
            or you can pick a destination ("export")

    import snapshot from rect (the rect of grc 1)
    export snapshot from rect (the rect of grc 1) to img 1 as PNG

2) CARDSHOT: 
       - Gets an image of the region of an object
       - Image includes overlapping objects on the card only
            (overlapping windows from Rev or any other program
            are ignored)
       - Dumps the image at the center of the current card ("import"),
            or you can pick a destination ("export")

   import snapshot from rect (the rect of grc 1) of this card
   export snapshot from rect (the rect of grc 1) of this card \
       to img 1 as PNG

3) OBJECTSHOT:
       - Gets an image of the object itself
       - Blends or inks are ignored
       - Destination can be a file, variable, or image object

   export snapshot from grc 1 to img 1 as PNG


-- If you place the blended graphic into a group, you can also get:

4) DARKSHOT:
       - Gets an image of the group object and its contents
       - Blends or inks for all objects are ignored
       - Destination can be a file, variable, or image object
       - Fills the transparent areas of the group object with black
            with the group's objects overlaid on top of it; the
            black extends out to the margins of the group

  export snapshot from group 1 to img 1 as JPEG

5) GROUPSHOT:
       - Gets an image of the group object and its contents
       - Property displays blends or inks
       - Destination can be a file, variable, or image object
       - The transparent areas of the group object remain
            transparent, out to the margins of the group

  export snapshot from group 1 to img 1 as PNG

Are there any others I may have missed here? I was thinking of putting up an
image with all these different options displayed to make it easier to pick
what to do in a given situation...

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/





More information about the Use-livecode mailing list