开发者

Erase operation in quartz 2D

开发者 https://www.devze.com 2022-12-31 03:28 出处:网络
Any suggestions on how to perform erase operat开发者_JAVA技巧ions in Quartz 2D?CGContextClearRect(UIGraphicsGetCurrentContext(), rect);

Any suggestions on how to perform erase operat开发者_JAVA技巧ions in Quartz 2D?


CGContextClearRect(UIGraphicsGetCurrentContext(), rect);


   if (clear) {

        CGContextSetBlendMode(UIGraphicsGetCurrentContext(),kCGBlendModeNormal);
        CGContextSetStrokeColorWithColor(UIGraphicsGetCurrentContext(), [UIColor              colorWithPatternImage:[UIImage imageNamed:@"rainbow-colors-orange-320x480.jpg"]].CGColor);
       // your background image. make sure it is same size

   } else {
        CGContextSetBlendMode(UIGraphicsGetCurrentContext(),kCGBlendModeNormal);
        NSUInteger red, green, blue;
        sscanf([stringColor UTF8String], "#%02X%02X%02X", &red, &green, &blue);
        UIColor *colors = [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:1];
        CGContextSetStrokeColorWithColor(UIGraphicsGetCurrentContext(), [colors CGColor]);

   }
0

精彩评论

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