Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am trying to clear the currently drawn image on the cgcontext

I have drawn a uiimage on a cgcontext

CGContextDrawImage(tempContext, CGRectMake(0,0,myRect.size.width,myRect.size.height), imgRef);

but once user is done with the current image, i want to clear the tempContext so that I can rescale / manipulate the image and redraw it on the same context.

for this i want to clear the the context and make it clean. I tried CgContextClearRect but it didn't worked :(

like image 286
Sajid Avatar asked Jan 28 '10 12:01

Sajid


1 Answers

try this one, it works for me: CGContextClearRect(UIGraphicsGetCurrentContext(), rect);

like image 88
Hoang Pham Avatar answered Nov 15 '22 12:11

Hoang Pham