Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
on mouseUp
choose pencil tool
set the pencolor to "black"
end mouseUp
I have assigned the code to a button. However, once the button is clicked the cursor will always be a pencil tool and you cannot select another button on the stack.
I have also tried using the 'Mouseenter' and 'Mouseexit' on the image to change the tools from the pencil tool to a cursor...but no success.
So, how would I be able to get the user to draw an image and be able to use buttons (say to change the pen colour or something?)
That way you choose the pencil tool (or whatever) with your button, paint in the image, as soon as you move out of the image the cursor reverts to the browse tool.
This may or may not be what you want, give it a try.
Or simply (a little less semantically challenging)
...
put empty into img "your_image"
...
how easy, thank you,
somehow the "semantic challenges" seem to attract me isn't the "semantic challenge" what makes a 'real' programming language?
cheers
bernd
The script works perfectly! However, after a good hour of trying, reading manuals and searching the forum...can anyone tell me how I could export the image drawn in the image area as a picture file? Such as a .jpg or a .bmp or something?
the only soluton is to create a palette window with your "tools", just like in the Rev IDE. ...
Klaus
Hi Klaus, can you elaborate on implementation of the palette? I tried implementing this approach by placing the "canvas" on a card in the mainstack and the palette on a card on a substack.
However, the create graphics command places the selected tool on the palette card and I can't figure out how to specify that the graphic should be created on the "canvas" on the mainstack. Any ideas on how to remedy this?
I was referring to PAINT tools which will only work sufficiently in a palette!
You can "set the defaultstack" first before creating graphics:
...
set the defaultstack to "stack where the graphic should appear"
create graphic "new_graphic1"
...