iOS - 自定义相机取景框

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

    imagePicker.delegate = self;

    imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;//获取类型是摄像头,还能够是相册

    imagePicker.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

    imagePicker.allowsEditing = NO;//若是为NO照出来的照片是原图,好比4s和5的iPhone出来的尺寸应该是(2000+)*(3000+),差很少800W像素,若是是YES会有个选择区域的方形方框

// imagePicker.showsCameraControls = NO;//默认是打开的这样才有拍照键,先后摄像头切换的控制,一半设置为NO的时候用于自定义ovelay

// UIImageView *overLayImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 640)];
// overLayImg.image = [UIImage imageNamed:@"overlay.png"];

// imagePicker.cameraOverlayView = overLayImg;//3.0之后能够直接设置cameraOverlayView为overlay
// imagePicker.wantsFullScreenLayout = YES;

    [self presentModalViewController:imagePicker animated:YES];