允许编辑错误的UIImagePickerController裁剪图像,在顶部留下黑条 [英] UIImagePickerController that allowsEditing incorrectly crops the image leaving a black bar across the top

查看:515
本文介绍了允许编辑错误的UIImagePickerController裁剪图像,在顶部留下黑条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iPad上的popover中使用UIImagePickerController与前置摄像头拍照。我将allowsEditing设置为YES,并在拍摄照片后获得内置移动和缩放视图的精彩内容。此视图中的裁剪矩形在屏幕上测量为320x267,尽管图像被裁剪为320x320平方( http://dl.dropbox.com/u/2246698/moveAndScale.png )。如果我按原样接受图像而不调整大小或移动图像,则顶部有一个约25像素高的黑条,就像裁剪矩形在图像上的位置太高一样( http://dl.dropbox.com/u/2246698/cropped.png )。实际上,如果我从媒体信息字典中获取该裁剪矩形(通过UIImagePickerControllerCropRect),则表明裁剪矩形的y原点为-39。这似乎打破了默认情况下图像将被错误地裁剪,通常当它看起来被打破时,因为我做错了。有没有人见过这个或者知道一些对我的庄稼有益的设置?

I'm using UIImagePickerController in a popover on the iPad to take a picture with the front camera. I set allowsEditing to YES and get the awesome built in "Move and Scale" view after taking the picture. The crop rectangle in this view measures 320x267 on the screen despite the fact that the image is cropped to a 320x320 square (http://dl.dropbox.com/u/2246698/moveAndScale.png). If i accept the image as is without resizing or moving it, there is a ~25px high black bar across the top as if the crop rectangle has been positioned too high on the image (http://dl.dropbox.com/u/2246698/cropped.png). In fact, if i get that crop rectangle from the media info dictionary (via UIImagePickerControllerCropRect) it shows that the y origin of the crop rectangle is at -39. This seems broken that the image would be incorrectly cropped by default and usually when it seems broken it's because i did it wrong. Has anyone ever seen this or know of some setting to twiddle that will be good for my crops?

非常感谢。

推荐答案

我看到完全相同的行为。它必须是一个bug,但如果是,我不知道为什么更多的人不抱怨它。它的另一个问题是你无法将图片移动到边缘进行裁剪以包含该部分 - 它总是滑回到中间。

I see the exact same behavior. It MUST be a bug, but if it is, I don't know why more people aren't complaining about it. Another problem with it is that you can't move the picture to the edges to crop to include that part--it always slides back to the middle.

如果你缩放它,然后你可以移动它,但你永远不能移动它足够能够包括左边缘或右边缘。

If you zoom it, then you can move it, but you can never move it far enough to be able to include the left or right edges.

事情是无用的。

这篇关于允许编辑错误的UIImagePickerController裁剪图像,在顶部留下黑条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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