Edit image after taking a picture

前端 未结 2 842
粉色の甜心
粉色の甜心 2021-02-01 11:16

I\'m currently making an iphone app where the user takes a photo or select it from an album, then an overlay is placed over the image. The user can then scale, rotate and save t

2条回答
  •  情书的邮戳
    2021-02-01 11:40

    For Q1, is it possible to implement an action sheet, so that the user can choose to use the photo from an album or take a new pic.? with the action sheet function as something like the following:

    -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
        if (buttonIndex == 0) {
            picker = [[UIImagePickerController alloc]init];
            picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
            picker.delegate = self;
            [self presentModalViewController:picker animated:YES];
            [picker release];
        }
    
        else if (buttonIndex == 1) {
            if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
                picker = [[UIImagePickerController alloc]init];
                picker.sourceType = UIImagePickerControllerSourceTypeCamera;
                picker.allowsEditing = YES;
                picker.delegate = self;
                [self presentModalViewController:picker animated:YES];
                [picker release];
            }
            else {
                UIAlertView *noCameraMsg = [[UIAlertView alloc] initWithTitle:@"no camera on this phone" message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
                [noCameraMsg show];
                [noCameraMsg release];
    
            }
    
    
    }
    

提交回复
热议问题