ca-archived / iOS-NBUImagePicker

Modular image picker with Simulator-compatible AVFondation camera, assets library, filters and more.
http://cyberagent.github.io/iOS-NBUImagePicker
Apache License 2.0
193 stars 48 forks source link

Zoom Feature #18

Open anilios opened 8 years ago

anilios commented 8 years ago

How can i enable zoom in/out feature in NBUImagePicker?

rivera-ernesto commented 8 years ago

Check the code and demo project for NBUAssetsGroupViewController's selectionChangedBlock then you can your own controller or use a NBUGalleryViewController which handles zoom.

anilios commented 8 years ago

Sorry, i guess my question was not clear enough. I mean to say before we take picture is there a way that we can have zoom in/out to take pictures.

rivera-ernesto commented 8 years ago

Aaah. I see. That would be something like a "digital zoom" of the iPhone camera.

The camera preview is a special layer added to NBUCameraView. You could embed that view inside a UIScrollView and handle pinch to zoom as usual. Then you would need use the zoomed section rect to crop the output of takePicture:. There are several crop methods in UIImage+NBUAdditions that you could use.