开发者

iPhone Drawing Application (Not OpenGL)

开发者 https://www.devze.com 2023-03-21 20:02 出处:网络
I\'m new to iPhone drawing field. I need to draw simple drawing on iPad. After I clicked button (that I created on same UIView)I need to erase those lines I was drawn.

I'm new to iPhone drawing field. I need to draw simple drawing on iPad. After I clicked button (that I created on same UIView)I need to erase those lines I was drawn.

In short;

Need to Draw a line.--> Click Button---> Erase those lines.

Now I Can draw A Line. But I want to erase those links and I fond useful links, for drawing and for erasing.

Question:

  1. So How can I convert My Drawing image to CGImageRef ?

  2. Is their any learning material fo开发者_运维知识库r this ?

  3. Is there any sample iPhone or iPad project for Drawing and erasing ?

Without Using OpenGl :)

Thank You.


Simple idea to perform erase operation is, set your current brush color to background color and this will virtually implements an eraser tool.

Draw a Line ---> Click on Eraser Button ---> use same paint method with background color(increased brush size)

Most of the drawing apps will use only white color as background, So that if you use white color brush for eraser with the same painting method will act as eraser. But if you use some other backgrounds like images you have to go for other methods.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号