About Drawing pad

  • zhaojany
  • Student
  • Student
  • User avatar
  • Joined: Aug 03, 2006
  • Posts: 78
  • Status: Offline

Post November 17th, 2007, 10:13 pm

I'm going to make a drawing pad ,which the user can draw a doodle .
The problem is how to implement an eraser tool .Using the bitmap class or what else?

here is an example: http://www.mykaka.cn/cgs/flashpainter2.swf
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 17th, 2007, 10:13 pm

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post November 23rd, 2007, 5:50 pm

is the background a solid color? If so you could just "paint" over the drawing with the background color...
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8211
  • Loc: USA
  • Status: Offline

Post November 23rd, 2007, 10:19 pm

zhaojany and everyone who will view this... when I went to that site my anti-spyware utility warned me that the site is dangerous...
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • zhaojany
  • Student
  • Student
  • User avatar
  • Joined: Aug 03, 2006
  • Posts: 78
  • Status: Offline

Post December 16th, 2007, 3:56 am

Bogey wrote:
zhaojany and everyone who will view this... when I went to that site my anti-spyware utility warned me that the site is dangerous...


but i didn't receive the warn.if it did, i'm sorry for that and the site isn't mine .
  • zhaojany
  • Student
  • Student
  • User avatar
  • Joined: Aug 03, 2006
  • Posts: 78
  • Status: Offline

Post December 16th, 2007, 4:26 am

graphixboy wrote:
is the background a solid color? If so you could just "paint" over the drawing with the background color...

The background isn't a solid color.And i have made one by use the blendMode but when getPixel, the erased part's color is black.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post December 16th, 2007, 10:16 am

Yes, i think you need a bitmap class.
Take a look here: smudge & redraw.
Didn't use the bitmap class till now, but i think you can use it for erasing.
In fact, the erasing is just as graphixboy said, only you don't have a solid color, u have the background image which you restore, just like in the example above.
What i think is that whenever the eraser tool is involved, a new graphic is created having it's source from the background image. As you can see, in that example all the user actions (in this case mouse movement) are saved in a variable ... probably an array.
Also, for every new shape created, a new movieclip with a higher depth is created, so it will always stay above the others.
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • zhaojany
  • Student
  • Student
  • User avatar
  • Joined: Aug 03, 2006
  • Posts: 78
  • Status: Offline

Post January 19th, 2008, 4:33 pm

Thank you IceCold. And Thanks for your example . Till now i didn't make it ,but i won't quit, no matter how manny times i will try to till it is solved.And if i did it i will let u know. :)

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 43 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.