博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UIColor 转换为 UIImage 《转》
阅读量:4071 次
发布时间:2019-05-25

本文共 402 字,大约阅读时间需要 1 分钟。

  1. - (UIImage *) createImageWithColor: (UIColor *) color
  2. {
  3.     CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
  4.     UIGraphicsBeginImageContext(rect.size);
  5.     CGContextRef context = UIGraphicsGetCurrentContext();
  6.     CGContextSetFillColorWithColor(context, [color CGColor]);
  7.     CGContextFillRect(context, rect);
  8.     
  9.     UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
  10.     UIGraphicsEndImageContext();
  11.     return theImage;
  12. }

转载地址:http://mjeji.baihongyu.com/

你可能感兴趣的文章
webServer kzserver/1.0.0
查看>>
hd printer lexmark / dazifuyin / dayin / fuyin
查看>>
OS + Unix IBM Aix basic / topas / nmon / filemon / vmstat / iostat / sysstat/sar
查看>>
my ReadMap subway / metro / map / ditie / gaotie / traffic / jiaotong
查看>>
OS + Linux DNS Server Bind
查看>>
自定义切面会吃掉异常,导致事务不生效的问题。
查看>>
我们发送一个请求时,服务端的javax.servlet.http.HttpServletRequest帮我们做了什么?
查看>>
一、实现多线程的三种方式
查看>>
新手报到第一天
查看>>
折半查找法
查看>>
VirtualBox安装Centos6.4不能为虚拟电脑打开一个新的任务
查看>>
Virtual 下安装CentOs6.4
查看>>
CentOS下配置软RAID
查看>>
GET http://test01.com/jquery-1.9.1.min.js [HTTP/1.1 404 Not Found 3ms]
查看>>
echo(),print(),print_r()之间的区别?
查看>>
jQuery中$('#selector).html('')是清空??----html()、text()、val()的区别
查看>>
欢迎使用CSDN-markdown编辑器
查看>>
Python使用web.py读取Mysql的数据
查看>>
web.py操作mysql的数据
查看>>
python类的详析
查看>>