在obj-c (xcode iphone)中有没有办法显示来自PCX数据的图像?我有一个包含PCX图像的所有二进制数据的NSData对象。
发布于 2011-11-12 06:27:32
我有一个包含PCX图像的所有二进制数据的NSData对象。
UIImage类引用:有一个实例方法initWithData:- (id)initWithData:(NSData *)data
UIImage * pcxImage = [[[UIImage alloc] initWithData:pcxData] autorelease];
// where pcxData is NSData object of binary data of the image然后使用UIImageView将其作为subView添加到视图中或执行其他操作
UIImageView * myImageView = [[[UIImageView alloc] initWithImage:pcxImage] autorelease];
[myImageView setFrame:CGRectMake(50.0f,50.0f,100.0f,100.0f)];
[self.view addSubView:myImageView];https://stackoverflow.com/questions/8100707
复制相似问题