Snapshot stack (was: Import from rect)

Thomas McGrath III mcgrath3 at mac.com
Sat Jan 24 23:54:07 EST 2009


Wilhelm,

This is a good observation and study of the inner workings of  
snapshots. There are many variations in effects that can be  
accomplished here. I especially like the explanation of what I was  
troubled with at first that the first rect in parens is the size and  
the second is the location. I think the global location can use a bit  
more explanation. I will be playing with this for a bit.

Regards,

Tom McGrath III
Lazy River Software
3mcgrath at comcast.net

iTunes Library Suite - libITS
Information and download can be found on this page:
http://www.lazyriversoftware.com/RevOne.html


On Jan 24, 2009, at 6:16 PM, Wilhelm Sanke, FB01 wrote:

> For the few who might be interested in such things I have put  
> together a stack
> demonstrating various ways of producing and using snapshots, thereby  
> following
> the questions and findings in the recent thread "Import from  
> rect" (especially
> of Thomas McGrath, Ken Ray, and Scott Rossi):
>
> <http://www.sanke.org/Software/SnapshotTestStack.zip>
>
> The Rev docs about "snapshots" have become increasingly detailed  
> over time, but
> they do not - understandably - cover every aspect, and - they still  
> contain an
> old error, namely concerning the paintcompression format of imported  
> snapshots.
>
> The teststack allows to set the properties of the selection graphic  
> - with the
> help of which snapshots are taken from an underlying image - in  
> "real time",
> i.e. you can set blendlevel, fillcolor, and the ink directly and  
> watch the
> changes in the appearance of the area of the graphic and the image  
> beneath it.
>
> 20 different ways related to snapshot taking are demonstrated (with  
> almost no
> commentaries), concerning "simple" snapshots, alphadata, maskdata, and
> extracting blendlevel and inks.
>
> Additional remarks to some of the aspects:
>
> - I found it confusing at first when I encountered a syntax like  
> "import/export
> snapshot of rect(the rect of grc 1) of grc 1". Experimenting with  
> this I
> understood that this twofold reference is not just tautological, but  
> determines
> different components of the snapshot. The first term - in the  
> brackets -
> determines the *dimensions* of the rect, the second states - as it  
> were - the
> location of the snapshot.
>
> - In all cases but one - what you see in the test stack is not  the  
> "snapshot
> taken", but the result of using the snapshot for masking the image  
> underlying
> the selection graphic.
>
> - The exception to this is the "Darkshot" - listed by Ken Ray in his  
> systematic
> overview - where I additionally display the actual snapshot (in a  
> diminished
> size) to show that the color of the represented transparent areas is  
> dependant
> (but not identical with) on the ink and fillcolor of the selection  
> graphic.
>
> - Using *globalloc* to determine the rect and loc of the snapshot is  
> about 5
> times faster than using card, window, image etc. as the reference to  
> the
> location, as in "import snapshot from the rect(<any rect>) of this  
> card"
>
> - The syntax "import/export snapshot from rect(<any rect> of this  
> stack" or "of
> stack <stackname>" is not possible. You have to get the windowID of  
> the stack
> first and then write "snapshot from rect(trect) of window twindowID".
> But it is possible to use "card x of stack <stackname>" and even -  
> see the docs
> - access hidden or closed stacks this way.
>
> - Snapshots taken from the selection graphic contain both alphadata  
> and
> maskdata, that can be used to mask the underlying image.
> Compared to alphadata using maskdata produces somewhat rough edges.
>
> - Other than when applying alphadata to the image "to-be-masked",  
> with maskdata
> you need to crop the image "to-be-masked" to the rect of the *group*  
> that
> contains the selection graphic. The graphic and the group containing  
> the graphic
> have different dimensions. When you group a graphic, width and  
> height of the
> group are greater than those of the graphic.
> "export snapshot from rect(the rect of grc 1) of group 1" combined  
> with cropping
> the "image-to be-masked" to the rect of the graphic results in a  
> distorted
> rectangle - instead of an oval. Cropping the "image-to be-masked" to  
> the group
> produces the correct result.
>
> Regards,
>
> -- 
> Wilhelm Sanke
> <www.sanke.org/MetaMedia>
>
> --------------------------------------------------------
> This mail sent through http://www.uni-kassel.de/www-mail
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list