【发布时间】:2014-06-18 10:18:57
【问题描述】:
我想在 UIImage 上画一些线。我能够在上下文中绘制线条,最后我在使用以下代码从上下文中获取图像之前将背景图像绘制到它:
UIGraphicsBeginImageContext(self.bounds.size);
CGRect newFrame = self.frame;
newFrame.origin.y = 0;
[self.backgroundImage drawInRect:newFrame];
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *saveImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
问题是:self.backgroundImage.imageOrientation 是 3 但 saveImage.imageOrientation 是 0。我怎样才能为 saveImage 获得相同的 imageOrientation?
【问题讨论】:
-
您好,我也有同样的问题。那么你能帮忙看看如何获得相同的方向吗?
标签: ios objective-c uiimage