ios - Cropping an AVCaptureSession preview -


i'm displaying video preview of 320x320 capture window, , using videogravity have fill square:

capturevideopreviewlayer.videogravity = avlayervideogravityresizeaspectfill; 

i'm grabbing photo quality image session , cropping it, starting @ 0, 0. problem have saved image shows more top (but not left) of frame preview. i'd see top of frame, seems i'm seeing middle section, hope i'm explaining myself properly.

here code snippet if helps:

avcapturevideopreviewlayer *capturevideopreviewlayer = [[avcapturevideopreviewlayer alloc] initwithsession:session]; capturevideopreviewlayer.frame = _cameraview.bounds; [_cameraview.layer addsublayer:capturevideopreviewlayer]; capturevideopreviewlayer.videogravity = avlayervideogravityresizeaspectfill;  avcapturedevice *device = [avcapturedevice defaultdevicewithmediatype:avmediatypevideo]; 

thanks in advance help.

cheers.

i couldn't figure out how this, decided fix changing cropping region instead of preview region.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -