捕获图像后捕获的捕获图像:Swift

时间:2015-12-08 17:29:38

标签: swift camera avfoundation

简短而简单,在预览中加载时,我拍摄的图像会从两侧被挤压。

长版本:我目前正在https://github.com/imaginary-cloud/CameraManager/blob/master/camera/CameraManager.swift使用找到的CameraManager Pod。我的问题是,在拍完照片之后,它会在两侧挤压一点图像。宽度不是我看到的。我预览的范围(我通过相机看到的)是view.frame.bounds,我对imageView(我刚抓到的)的界限是preview.frame.bounds。如果您需要更多信息,如果需要的话,我可以拍下发生的事情。

如果你需要代码只是评论,我可以告诉你。非常感谢任何反馈。

1 个答案:

答案 0 :(得分:1)

问题是我没有设置图像视图的contentMode。我所要做的就是添加这一行

imageView.contentMode = UIViewContentMode.ScaleAspectFill

重复:

How to manage UIImageView content mode?

capture image is stretched using avcapture session

很抱歉没有经过深入研究就发布了一个问题。我不是谷歌正确的查询。