Hi all,
I am attempting to draw in the touchesMoved method. As yet the only way I know to draw (I'm a beginner) is to:
1. create a context using UIGraphicsBeginImageContext.
2. send the UIImage if the UIImageView the message drawInRect, providing a rectangle of the entire image.
3. fetch the context using UIGraphicsGetCurrentContext.
4. do my drawing in the context using CGContextBeginPath, CGContextMoveToPoint, CGContextAddLineToPoint and CGContextStrokePath.
5. store the image into the UIImageView using UIGraphicsGetImageFromCurrentImageContext.
However this is taking too much time. What is the faster way to draw?
FYI normally on any other system what I'd do is clip my drawing area to just the rectangle I'm affecting, and clip the blit from image to screen. However when I attempt to clip the drawing region with drawInRect, this ends up -clearing- the area outside of that rectangle in the UIImage. There must be a way to speed this up...
Thank you.
I am attempting to draw in the touchesMoved method. As yet the only way I know to draw (I'm a beginner) is to:
1. create a context using UIGraphicsBeginImageContext.
2. send the UIImage if the UIImageView the message drawInRect, providing a rectangle of the entire image.
3. fetch the context using UIGraphicsGetCurrentContext.
4. do my drawing in the context using CGContextBeginPath, CGContextMoveToPoint, CGContextAddLineToPoint and CGContextStrokePath.
5. store the image into the UIImageView using UIGraphicsGetImageFromCurrentImageContext.
However this is taking too much time. What is the faster way to draw?
FYI normally on any other system what I'd do is clip my drawing area to just the rectangle I'm affecting, and clip the blit from image to screen. However when I attempt to clip the drawing region with drawInRect, this ends up -clearing- the area outside of that rectangle in the UIImage. There must be a way to speed this up...
Thank you.