用UIColor创建UIImage
来源:互联网 发布:万人老虎机系统源码 编辑:程序博客网 时间:2024/06/08 06:03
+(UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size {
@autoreleasepool {
CGRect rect = CGRectMake(0, 0, size.width, size.height);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, color.CGColor);
CGContextFillRect(context, rect);
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
}
0 0
- 用UIColor创建UIImage
- iOS开发,用UIColor创建UIImage
- UIColor创建UIImage备忘
- 通过UIColor颜色创建UIImage
- iOS 用UIColor来构造一个UIImage
- UIColor生成UIImage
- UIColor 转 UIImage
- 由UIColor 生成 UIImage
- UIColor和UIImage转换
- UIColor转化UIImage
- UIColor转化为UIImage
- UIColor, UIFont, UIImage
- UIColor转UIImage
- UIColor和UIImage转换
- iOS-UIImage 互转 UIColor
- UIImage 和 UIColor 互转
- UIColor和UIImage转换
- UIColor和UIImage互转
- 约德尔测试
- python导出excel
- android官方侧滑菜单DrawerLayout详解
- UILabel自适应高度
- pip使用本地缓存文件来安装包
- 用UIColor创建UIImage
- ont-hot (独热)编码
- C++ Builder 字符串时间格式转换为TDateTime方法
- for循环和for-in循环
- Spring Bean的解析 RuntimeBeanReference
- iOS HTTP到HTTPS证书问题
- 如何判断两个时间是否是同一天
- Android仿支付宝支付密码输入框
- 14.5.5.2 Deadlock Detection and Rollback Deadlock 检测和回滚