0

关于如何在 Quartz 2D 中执行擦除操作的任何建议?

4

2 回答 2

0
CGContextClearRect(UIGraphicsGetCurrentContext(), rect);
于 2010-09-14T16:16:03.727 回答
0
   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]);

   }
于 2013-11-13T06:29:55.893 回答