UIImagePickerController图像大小 [英] UIImagePickerController image size

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

问题描述

我在应用程序中使用UIImagePickerController拍照,并且使用自己的控件,这意味着UIImagePickerController showsCameraControls属性设置为NO,并且在overlayView内有一个UIButton可以拍摄照片.现在,我注意到我保存在照片库中的图像实际上显示的区域比预览视图中显示的区域更大.还有其他人遇到过同样的问题吗?有什么解决方案可以使图片显示预览中的内容吗?

I'm using UIImagePickerController in my app to take pictures and I'm using my own controls, which means that the UIImagePickerController showsCameraControls property is set to NO and I have a UIButton inside the overlayView that shoots the pictures. Now, I noticed that the image that I save in the Photo Library is actually showing a bigger area than what shows in the preview view. Has anybody else had the same issue? Any solution to get the picture showing just what was in the preview?

推荐答案

通过预览,我认为您是在谈论图像选择器界面(而不是关闭图像选择器界面后出现的默认预览屏幕).

By preview I assume, you are talking about image picker interface (and not the Default preview screen that appears after dismissing the image picker interface).

您应用于图像选择器界面的转换(使用cameraViewTransform)不会反映在所拍摄的图像上.例如,如果您尝试缩放(放大和缩小)应用比例,则需要在获得的图像上应用相同的(变换),以使图像在图像选择器界面中与实际保存的图像保持同步.
同样,在应用转换时,您还必须考虑图像方向.

The transforms you apply to image picker interface (using cameraViewTransform) donot reflect on the image taken. For example, if you are trying to zoom (in and out) applying scale, you need to apply the same(transform) on the image obtained in order to keep the image in image picker interface and actual saved image in sync.
Also you will have to consider the image orientation into consideration while applying the transforms.

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

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