Is it true that if it is in UIKit, including drawRect
, the HD aspect of Retina display is automatically handled? So does that mean in drawRect
, th
Also try this one:
- (UIImage *)maskImageWithColor:(UIColor *)color
{
CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height);
UIGraphicsBeginImageContextWithOptions(rect.size, NO, self.scale);
CGContextRef c = UIGraphicsGetCurrentContext();
[self drawInRect:rect];
CGContextSetFillColorWithColor(c, [color CGColor]);
CGContextSetBlendMode(c, kCGBlendModeSourceAtop);
CGContextFillRect(c, rect);
UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return result;
}