In my app, I want to draw a dot on the screen (where the user touches). After adding it, I save the incrementalImage
and the next point will be added to this image.
The problem is, that the first point doesn't appear. What am I missing?
UIGraphicsBeginImageContextWithOptions(self.bounds.size, YES, 0.0);
if (!self.incrementalImage) // first time; paint background white
{
UIBezierPath *rectpath = [UIBezierPath bezierPathWithRect:self.bounds];
[[UIColor whiteColor] setFill];
[rectpath fill];
}
[self.incrementalImage drawAtPoint:CGPointZero];
CGContextFillEllipseInRect(UIGraphicsGetCurrentContext(), CGRectMake(point.x - roundf(_lineWidth / 2.0), point.y - roundf(_lineWidth / 2.0), _lineWidth, _lineWidth));
self.incrementalImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();