Snapshot within a circle
richmondmathewson at gmail.com
Fri Jan 3 14:37:01 EST 2014
On 03/01/14 20:58, Jim Hurley wrote:
> I am a volunteer at the local library. They have a program for young children and they want to include my Kaleidoscopic draw program. (They have a bank of 20 computer available to the public. And, by the way, excuse my ignorance, but would it be possible, and legal to put the public version of RunRev on these computers?)
> Right now the kids can export a snapshot of their efforts, and they want to be able to post them on the web, Facebook etc. “Look, see what I drew!”
> The snapshot is everything within the rect of a black circle of user defined radius and it is exported to Preview (on the Mac).
> In Preview the image includes a gray rectangle around the circle.
> Right now to clean this up we go to Photoshop and use the magic wand to erase the gray outside the circle.
> So, at long last, my question. Is there a way within RunRev, by script, to erase all color pixels outside the circle before sending it off to Preview?
I'm not quite sure why you need the black square.
Go here: http://forums.runrev.com/viewtopic.php?f=25&t=18634
There's a stack . . .
> Here is the code (thanks to someone out there, I sorry about forgetting who you are, I’m 81 now with ever diminishing cognitive abilities) to get the image into Preview:
> on mouseUp
> ask "Please name this image." with "Kaleidoscope"
> hide group “showhidegroup” —Everything outside the oval rect is hidden.
> if it is "" then exit mouseUP
> put "/" & it & ".png" into tName
> put specialFolderPath ( "desktop") & tName Into tPathAndName
> export snapshot from rect (rect of graphic "oval") of this card to file tPathAndName as PNG
> launch document tPathANDNAME —That turns out to be Preview on he Mac
> show group “showhidegroup” —Show the things previously hidden
> end mouseUp
> Jim Hurley
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode