xcode - How Can I Call the "use" button of a UIImagePicker? -
i can call image picker take photo [picker takepicture];
but after that, want use image took automatically, code, not with: 1didfinishpickingmediawithinfo:1
but void function of picker... can i?
[picker takepicture]; picker.cameraflashmode = uiimagepickercontrollercameraflashmodeauto; picker.cameraflashmode = uiimagepickercontrollercameraflashmodeon; i call function above without real click on "use" button
- (void)imagepickercontroller:(uiimagepickercontroller *)picker2 didfinishpickingmediawithinfo:(nsdictionary *)info { nslog(@"didfinishpickingmedia"); [picker2 dismissviewcontrolleranimated:yes completion:null]; nsstring *mediatype = [info objectforkey:uiimagepickercontrollermediatype]; if ([mediatype isequaltostring:(nsstring *)kuttypeimage]) { nslog(@"imagesave"); uiimage *image = [info objectforkey:uiimagepickercontrolleroriginalimage]; uiimagewritetosavedphotosalbum(image, self, @selector(image:finishedsavingwitherror:contextinfo:), nil); uialertview *alertview = [[uialertview alloc] initwithtitle:@"saved" message:@"image saved in camera roll" delegate:self cancelbuttontitle:@"ok" otherbuttontitles: nil]; [alertview show]; } else if ([mediatype isequaltostring:(nsstring *)kuttypemovie]) { nsstring *moviepath = [[info objectforkey: uiimagepickercontrollermediaurl] path]; if (uivideoatpathiscompatiblewithsavedphotosalbum (moviepath)) { uisavevideoatpathtosavedphotosalbum ( moviepath, nil, nil, nil); uialertview *alertview = [[uialertview alloc] initwithtitle:@"saved" message:@"video saved in camera roll" delegate:self cancelbuttontitle:@"ok" otherbuttontitles: nil]; [alertview show]; } } }
Comments
Post a Comment