ios 利用颜色生成UIImage
来源:互联网 发布:php 共享变量 编辑:程序博客网 时间:2024/06/05 20:51
-(UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size {
CGRect rect = CGRectMake(0, 0, size.width, size.height);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
CGRect rect = CGRectMake(0, 0, size.width, size.height);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
0 0
- ios 利用颜色生成UIImage
- 利用颜色值来生成UIImage
- 利用颜色值来生成UIImage
- iOS 根据颜色值来生成UIImage
- iOS:NSString生成UIImage
- IOS 颜色转换成UIImage
- iOS UIimage对象的生成
- ios 中把颜色转换为UIImage
- ios从rgb数据生成UIImage
- [iOS代码] 根据文字生成图片UIImage
- IOS 由RGB、UIColor生成UIImage
- ios从rgb数据生成UIImage
- UIImage:使用RGB颜色值来生成图片
- iOS 颜色生成image
- iOS中改变UIImage的颜色和大小的方法
- ios UIImage
- UIImage ios
- UIImage ios
- C语言之选择排序
- XYWi-Fi v2.0 简单的笔记本无线热点分享工具【Win】
- 修改Cocos2dx中的CCMessageBox的按钮文字
- Java学习路线图
- websphere参数配置
- ios 利用颜色生成UIImage
- UITextField的属性和用法.
- vmware10中开启Intel VT-x
- 键盘常用键的asii值
- IOS开发者中心生成证书时填写appID的问题
- redis 示例
- 将项目src下源文件拷贝到tempProject
- 取带runas的一些优秀小工具介绍
- 算法之排序小结1---插入排序(Java)