Draw pictures by color UIImage

+ (UIImage *)clearImageView {
    UIColor *color=[UIColor clearColor];
    CGRect rectum = CGRectMake ( 0 , 0 , 64 , 64 );
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context =UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, rect);
    UIImage *image =UIGraphicsGetImageFromCurrentImageContext();
    return image;
}

 

Guess you like

Origin www.cnblogs.com/cchHers/p/12297602.html