【问题标题】:Erase operation in quartz 2D石英 2D 中的擦除操作
【发布时间】:2010-05-23 20:16:09
【问题描述】:

关于如何在 Quartz 2D 中执行擦除操作有什么建议吗?

【问题讨论】:

    标签: iphone sdk quartz-graphics quartz-2d


    【解决方案1】:
    CGContextClearRect(UIGraphicsGetCurrentContext(), rect);
    

    【讨论】:

      【解决方案2】:
         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]);
      
         }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-03-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多