/**
* 生成图片
*
* @param color 图片颜色
* @param height 图片高度
*
* @return 生成的图片
*/- (UIImage*) GetImageWithColor:(UIColor*)color andHeight:(CGFloat)height{CGRectr=CGRectMake(0.0f,0.0f,1.0f, height);UIGraphicsBeginImageContext(r.size);CGContextRefcontext =UIGraphicsGetCurrentContext();CGContextSetFillColorWithColor(context, [colorCGColor]);CGContextFillRect(context, r);UIImage*img =UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();returnimg;}
网友评论