Page 1 of 1

Draw a line inside of an existing image

Posted: Sat Mar 24, 2012 8:44 pm
by septic
This should be easy, but I'm puzzled....

I have an image, and I want to draw a simple line (with my penColor, penHeight end penWidth) inside the same image object. How do I do this with code?

I dont want to fiddle with the imageData... way too complicated.
Overlaying a graphic with a line on the image and than taking a snapshot could work but I do not like this idea.

I'm looking for something like:
choose line tool
draw a line from 0,0 to 50,50 inside image id 1 <-- I'm missing this command

Any suggestions?
Thanks.
Mario

Re: Draw a line inside of an existing image

Posted: Sat Mar 24, 2012 11:50 pm
by jmburnod
Hi Mario

You can draw with the pencil too like that

Code: Select all

on mouseUp
   choose pencil tool
   drag from 0,0 to 50,50 -- All points must be inside the image
end mouseUp
Best regards

Jean-Marc

Re: Draw a line inside of an existing image

Posted: Sun Mar 25, 2012 10:16 am
by septic
Great Jean-Marc!
I completely missed the drag command!

This work perfectly:

Code: Select all

on mouseUp
   set the penColor to "green"
   set the penHeight to 5
   set the penWidth to 5
   choose line tool
   drag from 0,0 to 50,50  -- in an existing image, of course
   choose browse tool
end mouseUp
Thanks for the help.
Mario