iPhone上的自定义相机缩放功能 [英] Custom camera zoom functionality on iPhone

查看:294
本文介绍了iPhone上的自定义相机缩放功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是XCode的新用户。我试图开发一个具有重叠视图的自定义摄像头。我能够加载这个井,它的工作伟大。



现在,我要在重叠式视图上添加使用按钮激活的缩放功能。



我?



谢谢

c>

$


$ b b $ b

cameraViewTransform转换为
适用于相机的预览图像。



@property(非原子)CGAffineTransform
cameraViewTransform讨论b $ b transform仅影响实时预览
图像,不会影响您的
自定义重叠视图或默认的
图像选择器控件。您可以使用
此属性与
自定义控件结合实现您自己的
电子缩放行为。



您可以访问此属性只有当
的图像选择器的源类型是
设置为
UIImagePickerControllerSourceTypeCamera。
尝试为
访问此属性其他源类型导致
抛出
NSInvalidArgumentException异常。



可用性可在iOS 3.1和
以后。已在
中声明的内容UIImagePickerController.h


http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html


I am new to XCode. I am trying to develop a custom camera with an overlay view . I am able to load this well and it's working great.

Now I want to add zoom functionality activated with a button on the overlay view.

Can any one guide me? I'm trying to find out how to zoom the camera, but I haven not bene able to find anything.

Thank you

解决方案

You can use cameraViewTransform property :

cameraViewTransform The transform to apply to the camera’s preview image.

@property(nonatomic) CGAffineTransform cameraViewTransform Discussion This transform affects the live preview image only and does not affect your custom overlay view or the default image picker controls. You can use this property in conjunction with custom controls to implement your own electronic zoom behaviors.

You can access this property only when the source type of the image picker is set to UIImagePickerControllerSourceTypeCamera. Attempting to access this property for other source types results in the throwing of an NSInvalidArgumentException exception.

Availability Available in iOS 3.1 and later. Declared In UIImagePickerController.h

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html

这篇关于iPhone上的自定义相机缩放功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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