简体   繁体   中英

iphone : how to stop shutter animation?

I am having 2 issues.

1) I want to know how can I stop animation of shutter when camera is loaded? I am using UIImagePickerController. I have referred many answer from stack overflow but did not get succeed.

2) I have a custom button in camera using cameraOverlayView and want to open the photo library on click. I have code like:

- (void) showLibrabryPicker
{
    pickerLibrary = [[UIImagePickerController alloc] init];
    pickerLibrary.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    pickerLibrary.delegate = self;
    [self presentModalViewController:pickerLibrary animated:YES];
    [pickerLibrary release];
}

it gets called when camera is already shown.

Thnaks...

Using a UIImagePickerController , there's nothing you can do about that initial shutter animation. It's actually there to hide the startup time. You can switch to using the AVFoundation and getting an AVCaptureVideoPreviewLayer , which has no shutter animation, but you still get a latency between asking for the feed to start and it starting. I'm no hardware expert but I assume the delay is because the power management unit normally has that whole subsystem powered down.

Your code for showLibraryPicker looks more or less correct, though you may be calling presentModalViewController:animated: on the wrong actor. UIImagePickerController is a view controller, so if you haven't subclassed that (ie, the code you're writing is not itself part of the thing you have acting as a UIImagePickerController ) then you'll want to do [pickerController presentModalViewController:...] .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM