Custom camera zoom functionality on iPhone

前端 未结 1 1434
面向向阳花
面向向阳花 2021-01-01 08:19

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 functio

1条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-01 08:24

    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

    0 讨论(0)
提交回复
热议问题