UIImagePNGRepresentation ..... writeToFile 始终是横向的
每次我用相机拍照,然后保存时,图像总是横向的。这意味着我的 Xib 中的 UIImageView 是错误的。它的肖像 - 这就是我想要和期望的。我可以通过将图像旋转 90 度来纠正此问题,但即使如此,我也无法禁用显示原始风景照片和动画旋转本身的动画。如何确保相机中的 UIImageView 在保存时实际上处于纵向模式而不是横向模式,以及如何在 CGAffineTranformationMakeRotation 期间禁用动画?
Each time I use the camera to take a photograph, then save it the image is always in landscape. This means the UIImageView in my Xib is the wrong way around. Its Portrait - which is what I want and expected. I can correct this by rotating the image 90 degrees but even then I can't disable the animation which shows the original landscape photo followed by the animated rotation itself. How can I ensure the UIImageView from the camera is actually in portrait mode when saved and not landscape and, how can I disable the animation during the CGAffineTranformationMakeRotation ??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现这篇文章非常有帮助,它描述了在保存图像之前向 UIImage 添加一个类别以进行图像旋转:
http://www.platinumball.net/blog/2009/03/30/iphone-uiimage-rotation-and-mirroring/
然后一旦类别被实现,你就会做一些事情像这样:
I found this post to be very helpful, it describes adding a category to UIImage to do the rotation of the image before you save it:
http://www.platinumball.net/blog/2009/03/30/iphone-uiimage-rotation-and-mirroring/
And then once the category is implemented, you would do something like this: