Freehand drawing with Quartz 2D
Posted
by qutaibah
on Stack Overflow
See other posts from Stack Overflow
or by qutaibah
Published on 2010-03-25T01:31:29Z
Indexed on
2010/03/25
1:33 UTC
Read the original article
Hit count: 580
quartz-2d
|iphone-sdk-3.0
I am trying to develop a simple freehand-drawing app for red-marking some of my images. Below is a method that is called from within the drawRect.
I want to ask if there is a way to avoid add the path every time the path is redrawn?
Also, the way the draw method is set up, the drawing gets a bit slow and choopy after a few seconds. How can I improve the smoothness of the drawn path?
thanks
-(void)freehandDraw:(CGContextRef)context inRect:(CGRect)rect {
CGPathAddLineToPoint( path, NULL, drawTip.x, drawTip.y);
CGContextAddPath( context, path);
CGContextStrokePath(context);
} // method
© Stack Overflow or respective owner