Page 1 of 1
Paint Tools
Posted: Sun Jan 02, 2011 2:43 pm
by emmefisch
Is there a possibility to "record" the work done with the paint tools and get the code for that? Thanks for any idea.
I like to fill some parts of a picture programmaticaly.
Best
Fredi
Re: Paint Tools
Posted: Mon Jan 03, 2011 12:38 pm
by Mark
Hi Fredi,
You might be able to use a frontscript (mouseDown handler) to record clicks and tools. This will work with the graphics tools, not with the image/paint tools.
Kind regards,
Mark
Re: Paint Tools
Posted: Mon Jan 17, 2011 3:28 pm
by fredigertsch
Thanks Mark.
Re: Paint Tools
Posted: Mon Jan 17, 2011 6:22 pm
by dunbarx
Try these. There are certainly others you can use to get the starting and ending locs of anything you do, and the tools and targets you choose.
on mouseDown
put the target
end mouseDown
This will work in either the tools palette or your working stack.
on mousemove x,y
put the tool && x && y
end mousemove
This will give you a start on your drawing data. I bet you can make a "macro" recording of all your actions.
Craig Newman
Re: Paint Tools
Posted: Mon Jan 17, 2011 6:24 pm
by Mark
Hi Craig,
Have you actually tried that? I couldn't get it to work.
Mark
Re: Paint Tools
Posted: Mon Jan 17, 2011 7:22 pm
by dunbarx
Mark.
Yes. I placed the handlers into a card script, and inserted the card script into front, per your suggestion.
Craig
Re: Paint Tools
Posted: Mon Jan 17, 2011 7:26 pm
by Mark
Hi Craig,
Maybe I wasn't clear. I mean, did it also work for the paint tools, or only for the graphics and other tools?
Mark
Re: Paint Tools
Posted: Mon Jan 17, 2011 8:20 pm
by dunbarx
Mark.
Yes. I get a "bucket", or a "spray can" when I click on those tools. This is from the mouseDown handler.
And it is very important to pass mouseDown, I now see, or you will cripple ordinary tool selection methods.
I made a fld "gg" on a card (id 12821) so I could track the tool names:
on mouseDown
put the target & return after fld "gg" of cd id 12821 of stack "test1"
pass mouseDown
end mouseDown
Craig
Re: Paint Tools
Posted: Mon Jan 17, 2011 8:42 pm
by bn
Hi Craig, Mark,
I dont get the mouseMove to work if there is painting going on.
This does record coordinates and the tool if put into an image object.
Code: Select all
local sRecord
on mouseEnter
put the tool into tTool
put tTool && the milliseconds
if tTool is among the items of "pencil tool,bucket tool,brush tool,eraser tool,spray tool,line tool,curve tool" then
put true into sRecord
send trackMe to me in 10 milliseconds
end if
end mouseEnter
on trackMe
if sRecord then
if the mouse Is Down then
put the tool && the mouseLoc && the milliseconds
end if
if trackMe is not in the pendingMessages then
send trackMe to me in 10 milliseconds
end if
end if
end trackMe
on mouseLeave
put false into sRecord
end mouseLeave
Whether you can redo everything you want from this recording is an other question.
Kind regards
Bernd