Friday, July 30, 2010

Drawing in iPhone

Now, I am going to explain how to draw in iPhone.


For drawing we can use touch events (touchBegin and touchMoved).
First,create a View Based Application.
And then Add a new class which inherits from uiimageview, name of class be "MyImageView"
After that in MyImageView.h, add a CGPoint to store the starting Point and NSstring to to knoe the brush is for Drawing or Erasing.


MyImageView.h file look like








And in implemation File(MyImageView.m) look like






To Download complete project  Sample Code here

No comments:

Post a Comment