开发者

clearing screen after CGContextDrawImage

开发者 https://www.devze.com 2023-03-03 04:30 出处:网络
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 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));
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号