| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
9年前发布

UIColor转换为UIImage

/**   *  color转image   */  - (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;  }