clearing screen after CGContextDrawImage
I am trying for a image relaterd i-phone application.I am using a line of code
CGContextDrawImage(context1, CGRectMake(0, 0, width, height), imageRef);
I am working with multiple images.So i want to clear the screen after this .Any bui开发者_开发知识库lt in function using for this (Like in C we can use cleardevice in graphics).Any help appreciating.
Check out CGContextFillRect - just set the rect to be the whole view and the brush to be solid white :)
For example, to clear the image you just drew with white :
const CGFloat white[] = {1.0f, 1.0f, 1.0f, 1.0f};
CGContextSetFillColor(context1, white);
CGContextFillRect(context1, CGRectMake(0, 0, width, hight));
精彩评论