teepusink
teepusink

Reputation: 28892

Objective C - remove drawing

I've been using the code below to draw on an UIView

CGContextRef context = UIGraphicsGetCurrentContext(); 
CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor);
CGContextSetRGBFillColor(context, 0.0, 0.0, 1.0, 1.0);
CGContextSetAlpha(context, 0.5);
CGContextSetLineWidth(context, 10.0);
CGContextMoveToPoint(context, point.x, point.y);
CGContextAddLineToPoint(context, point.x, point.y);
CGContextStrokePath(context);

So that part works.
Now how do I clear my drawing? Most of the example just shows the drawing. Having a hardtime finding keyword to google.

Thanks,
Tee

Upvotes: 1

Views: 793

Answers (2)

annaken
annaken

Reputation: 1

[self setNeedsDisplay];

it sends the message drawRect: to the view.

Upvotes: 0

imaginaryboy
imaginaryboy

Reputation: 5989

Have you tried CGContextClearRect?

Upvotes: 1

Related Questions