UIImagePickerController图像方向 [英] UIImagePickerController Image Orientation

查看:130
本文介绍了UIImagePickerController图像方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我如何使用UIImagePickerController(相机和相册)代理确定图像的方向,相应旋转,并将其分配给UIImageView?

Can anyone tell me how to use the UIImagePickerController (camera and album) delegates determine the image's orientation, rotate accordingly, and assign it to a UIImageView?

推荐答案

不,UIImagePickerController不能明确地做。

No, UIImagePickerController cannot do it explicitly.

如果您想根据图片的内容来决定。这是一个困难的问题。如何在不理解图片内容的情况下确定图片的方向?

If you want to determine based on image's content. It is kind of hard problem. How can you determine an image's orientation without understanding the content inside of it?

我可以建议你一个技巧,你检查的宽度和长度的返回图像,看看它是纵向还是横向。为了旋转图像,外面有一些库和代码,但我没有尝试他们。您可以查看此blog

I can suggest you a trick that you examine the width and the length of the returned image and see if it is portrait or landscape. For rotating the image, there are some libraries and codes outside but I didn't try them much. You can take a look at this blog

这篇关于UIImagePickerController图像方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆