【发布时间】:2010-04-11 16:00:34
【问题描述】:
我需要从我的颜色创建的 UIImage(例如,我需要黑色的 1x1 像素图像)。
我有数组:
unsigned char *color[] = {0, 0, 0, 1};
如何从这个数组创建 UIImage ?
我试过了
unsigned char *bytes[4] = {0,0,0,1};
NSData *data = [NSData dataWithBytes:bytes length:4];
UIImage *img = [UIImage imageWithData:data];
但是这个方法没有结果...
【问题讨论】:
标签: iphone image uiimage nsdata cgimage