在中心缩放实时iPhone相机视图,“CGAffineTransformTranslate”不工作 [英] Scaled live iPhone Camera view in center, "CGAffineTransformTranslate" not working
问题描述
我有一点我无法解决的问题。我真的希望有人可以帮助我。我想调整实时相机视图的大小并将其放在中心,使用下面的代码:
I have a little problem which I could not solve. I really hope someone can help me with that. I wanted to resize the live camera view and place it in the center, using the following code below:
picker.cameraViewTransform = CGAffineTransformScale(picker.cameraViewTransform, 0.5, 0.56206);
picker.cameraViewTransform = CGAffineTransformTranslate(picker.cameraViewTransform, 80, 120);
但我得到的只是屏幕左上角的1/2尺寸缩放视图。似乎CGAffineTransformTranslate什么都不做。即使在我使用时翻译也不起作用:
But all I got was a scaled 1/2 sized view on the top left of the screen. It seems as though "CGAffineTransformTranslate" does nothing at all. The translation didn't work even when I used:
picker.cameraViewTransform = CGAffineTransformMake(1, 0, 0, 1, 80, 120);
翻译部分似乎对实时摄像机视图没有影响。
希望有人可以启发我。
The translation portion seems to have no effect on the live camera view. Hope someone can enlighten me.
谢谢。
推荐答案
<我是在同一条船上。我所做的是物理移动拾取器框架。
I was in the same boat. What I did was physically move the picker frame.
[picker.view setFrame:CGRectMake(xOffset,yOffset,picker.view.frame.size.width,picker.view.frame.size.height)];
这篇关于在中心缩放实时iPhone相机视图,“CGAffineTransformTranslate”不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!