I was using the drawing code from this tutorial to let someone draw in a small box: http://www.ifans.com/forums/showthread.php?t=132024
The default code draws on the entire screen, how do you limit the drawing to a small box on the screen?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In this examples the touches and the drawing happen in the main view of the view controller:
etc…
So if you change the frame of that view to a smaller size, the drawing should be limited to the smaller size automatically.
Or you could “move” the touch recognition and the drawing to a another smaller subview:
===== EDIT =====
Here is how to do it:
canvas, lastTouchPoint and drawImage are iVars.
I did not implement the doubleTap and Tap routines to clear the image and to draw a point, but this should be enough to get you started.