UIImage+Resize.h - 为 UIImageOrientationUp 方向给出错误的仿射变换
对于 UIImage 调整大小,我使用了以下类。
http://iphone.svn.wordpress.org/trunk/UIImage+Resize。 m
但我在 iPhone 的某些方向上遇到了问题,即我将手机与垂直表面对齐。它可以正确调整大小,但图像未正确进行仿射变换。图像方向不同。我在“transformForOrientation”方法中记录了消息,该方法调用了 UIImageOrientationUp,但我没有看到对该方向进行任何操作。我相信这就是我得到无效转换的原因。所以我需要帮助来解决这个问题。是否需要添加任何“CGAffineTransformTranslate”或“CGAffineTransformRotate”以获得正确的输出。
请告诉我。
谢谢。
For the UIImage resize I used the following class.
http://iphone.svn.wordpress.org/trunk/UIImage+Resize.m
But I am having issues in some iPhone orientation where I keep the phone in lined with a vertical surface. It does the resize properly but the image is not properly affine transformed. The image orientation is different. I logged the messages in the "transformForOrientation" method where it called the UIImageOrientationUp where I do not see any manipulation done to that orientation. I believe that's the reason for me to get an invalid transformation. So I need a help to fix this issue. Is there any "CGAffineTransformTranslate" or "CGAffineTransformRotate" to add in order to get the correct output.
Please advise me.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UIImage+Resize 方法中的
- (UIImage *)croppedImage:(CGRect)bounds;
方法不考虑图像的方向。在该方法中,将此行:替换
为:
The
- (UIImage *)croppedImage:(CGRect)bounds;
method in UIImage+Resize method doesn't take into account the orientation of the image.Within that method, replace this line:
with this: