29,031
社区成员
发帖
与我相关
我的任务
分享
没有根据每个像素点,直接生成UIImage的函数吗? Qt和MFC都有的 ios 中需要使用core graphic 框架来实现图形的绘制。2楼的方法可以先去试试。
ios 中需要使用core graphic 框架来实现图形的绘制。2楼的方法可以先去试试。
画一个像素点,并生成图像是这么画 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 *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();