本文共 402 字,大约阅读时间需要 1 分钟。
- - (UIImage *) createImageWithColor: (UIColor *) color
- {
- CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
- UIGraphicsBeginImageContext(rect.size);
- CGContextRef context = UIGraphicsGetCurrentContext();
- CGContextSetFillColorWithColor(context, [color CGColor]);
- CGContextFillRect(context, rect);
-
- UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- return theImage;
- }
转载地址:http://mjeji.baihongyu.com/