Page 1 of 1

SnapShots

Posted: Mon May 20, 2013 2:42 pm
by Traxgeek
Hi,

I've given this more than a couple of hours and have failed to find an answer :-(

I'm trying to create a simple colouring app for my kids - well that's my excuse to play with some ideas I have for LC ;-)

So;
-1- I use 'Answer file...' to select a suitable black and white line drawing (gotten of the web or scanned in myself)
-2- I put the image into an Image control held within a group (of just itself) - this means my original image will not be shrunk to the device screen size but, rather, can be scrolled around using the group's sliders... simple but sweet !
-3- I have a script that catches the mouse down event and draws a graphic ('line' type) in a user-selected colour and width...

All cool so far...

I then try to take a 'snapshot' of my image to save the part that's been coloured in/visible... BUT

the snapshot doesn't take into account my colouring-ins (graphics). There's just gotta be a way of doing this but... I'm stumped...

I'll keep trying but rather than continuing to bash my poor old sore head agains a LiveCode wall, I thought I'd post the question here.

I'm currently playing with including the mouse scribbles/paints/graphics in a group and take a snapshot of the group but... much head scratching... seem unable to achieve this.

On a separate but associated note (I'm loathe to ask two Qs in one post but...) how would I copy the image data from an image on one card to an image on another card ? In my case I load the image on one page (and am able to rotate it and size it there) then want to display the modified (rotated/resized) 'base' image on the colouring-in card... but am struggling badly with that too. The group (containing the image control) on the colouring-in card does resize itself to match the setup card's group/image size but displays no image... I <i> could </i> just do the image setup on the colouring-in page but figure my kids need a simple interface etc and not the additional clutter of the required controls (similarly, I <i> could </i> just hide the controls after I've set up the image for them but... there MUST be a proper way to do this... (tried, 'copy image... to...', tried 'set the source...', tried 'put the imagedata of... into...' none seem to display my image but the last one (put the imagedata...) does resize my colouring-in group to suit the setup image - just doesn't display the darn thing !!!!

Any and all pointers would be appreciated...

Thanks a mil.

Regards.

Re: SnapShots

Posted: Tue May 21, 2013 8:44 am
by BvG
As far as I know, if you start using the drawing tools, it creates a new image. But only if you don't hit a non-transparent, non-hidden image when you start drawing, because otherwise it'll draw into the existing image. It's also easy to create, duplicate and manage images and other objects, see the "create", "clone", and "copy" commands, as well as the "last" keyword.

Also note that html encoding is disabled, use BBCode if you want formatting like italics or bold.

Re: SnapShots

Posted: Sun May 26, 2013 6:30 pm
by FireWorx
I have been researching for a related project. Try looking at this post it might help.
http://forums.runrev.com/viewtopic.php? ... oll#p71877
also
if you want some code to take a snapshot of the screen and then attach it to email let me know.

Perhaps you could take a look at this example stack and help me with a little code from your stack. I can't seem to bring up the drawing tools in IOS to get this signature task done. Is your app IOS?
Dave

Re: SnapShots

Posted: Sun May 26, 2013 6:47 pm
by FireWorx
Oops.... From the IOS release notes: • paint tools (planned for a future release)

Re: SnapShots

Posted: Wed May 29, 2013 10:15 am
by Traxgeek
Hi,

Been away - sorry :-(

Thanks BvG. I think I'm beginning to understand - new to LC and loads and loads to learn.
My biggest wish at the moment is for a comprehensive list of all properties that can be applied to (and actually affect) each control. That would be brilliant and save me (and others I'm sure) hours of trial and error (and frustration!). I've seen the dictionary and understand it does display 'some' (many - but not ALL properties... nevermind, I'm building up my knowledge / arsenal of properties as I progress...
And... point taken with the BBCode ! - Thanks. (Now I just can't get my smilies to work (although the side bar says they;'re 'ON')... hmmm... (the one above is 'handmade' but they used to work for me... double hmmm...)

Hi FireWorx !
I'll go take a look. I note from the dictionary that one can set the angle / rotation of a graphic but it has no effect (on irregular polygons - such as scribbles/signatures/lines)... grrrr... I could do without having to code this from scratch... nevermind, maybe your link will throw some light on this one for me !
Do you still want me to take a look at your iOS script... I will do and have a little time so... no worries...
I'm coding two apps at the moment for both iOS and Android (hopefully) so much head scratching... One is a 'port' from PCSoft and the other is new but both do involve the ability to email an attachment and although I seem to have the e-mail side of things working I haven't yet gotten round to the attachment for mobile (works on desktop tests though).

Again, thanks both. I'm off to try and put my graphic (non regular polygon) rotation to sleep !

Let me know if the finished code (when I do get it finished) would be useful and I'll post it up.

Re: SnapShots

Posted: Wed May 29, 2013 11:03 am
by Dixie
Fireworx...

I have attached a stack that makes use of the line tool that would let you capture signatures... It is the basis on which I built 'skribble', a painting tool in the iTunes store... just scrawl your monicker on the card ..:-)

hope it helps.

Dixie

Re: SnapShots

Posted: Wed May 29, 2013 2:13 pm
by Traxgeek
Hi,

Further to all of my above...

Is there a way to put the points captured in a graphic into an image when the graphic has been finished ?

I'll explain a little further :

I want my kids to be able to draw / colour-in a line drawing BUT I'd like them to be able to go back and change their colouring-in so, at the moment, I capture the mouse down / move and up events to create a 'colouring in'. Each mouse down/move/up series of events is considered one 'colouring-in' graphic. Each of the movements is then saved along with the selected pen colour and tool width etc and, as such, can be redrawn / amended pretty easily.

My problem arises when I try to rotate a colouring-in or resize it... pretty simple if the series of points/'colouring-in' is an image but not so easy (it would appear) if the points remain as a graphic.

Hence my question.

Any ideas/pointers please ?