iOS - uiimage和uicolor相互转化
2016-09-05 17:16
495 查看
UIColor 转UIImage - (UIImage*) createImageWithColor: (UIColor*) color { CGRect rect=CGRectMake(0,0, 1, 1); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [color CGColor]); CGContextFillRect(context, rect); UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return theImage; } UIImage转UIColor [UIColor colorWithPatternImage:[UIImageimageNamed:@“bg.png"]]
相关文章推荐
- IOS中UIImage和UIColor相互转化
- IOS中UIImage与UIColor相互转化
- IOS中uiimage和uicolor相互转化
- iOS中uiimage和uicolor相互转化
- 颜色值转化成UIColor IOS
- iOS 时间戳 与 时间相互转化
- IOS---NSdata 与 NSString,Byte数组,UIImage 的相互转换
- ios 时间戳 当前时间 相互转化
- NSdata 与 NSString,Byte数组,UIImage 的相互转换---ios开发 Objective-C
- ios开发--UIImage转化成NSData
- ios 时间戳 当前时间 相互转化
- 把UIColor对象转化成UIImage对象
- NSString,NSData,Byte数组 ,UIImage的相互转化
- (ios)UIImage,CGImage和CGImageRef之间的转化
- iOS开发笔记(四):网页颜色值转化成UIColor
- ios开发--UIImage转化成NSData
- NSdata 与 NSString,Byte数组,UIImage 的相互转换---ios开发 Objective-C
- IOS---NSdata 与 NSString,Byte数组,UIImage 的相互转换
- IOS---NSdata 与 NSString,Byte数组,UIImage 的相互转换
- iOS 时间戳 与 时间相互转化