【发布时间】:2011-12-03 08:03:16
【问题描述】:
我正在尝试渲染位图以保存到用户的相册中,该位图的分辨率必须高于 320x480 iPhone 屏幕(但仍在 iOS 内存限制范围内)。 但是,使用此代码创建上下文:
UIGraphicsBeginImageContext(CGSizeMake(finalImgWidth, finalImgHeight));
CGContextRef ctx = UIGraphicsGetCurrentContext();
或 CG 模拟:
CGContextRef ctx = CGBitmapContextCreate(rawData, finalImgWidth, finalImgHeight, bitsPerComponent, bytesPerRow, colorSpace, kCGImageAlphaPremultipliedLast);
如果宽度或高度大于 320x480,则返回 nil 上下文。
还有其他方法可以创建高分辨率图像吗?
注意:我已经知道如何正常绘制上下文并截取屏幕截图。我需要一个可以缩放到典型照片分辨率的解决方案。
【问题讨论】:
标签: iphone objective-c ios cgcontext