调用原始相册

#pragma mark - 进入拼图相方法

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

#pragma mark - 相册代理

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    ((UIView*)[picker.view.subviews objectAtIndex:0]).frame = CGRectMake(0, 0, 320, 480-130);
    
    if ([picker sourceType] == UIImagePickerControllerSourceTypePhotoLibrary)
    {
        NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
        if ([mediaType isEqualToString:@"public.image"])
        {
            UIImage *imageJPEG = [info objectForKey:UIImagePickerControllerOriginalImage];//选取器控制器的原始图像

           

imageVIew = imageJPEG;
               
               
            }else{
                UIAlertView *alert = [[UIAlertView alloc]
                                      initWithTitle:@"图片添加已满"
                                      message:@""
                                      delegate:nil
                                      cancelButtonTitle:@"OK!"
                                      otherButtonTitles:nil];
                [alert show];
                [alert release];
            }
        }
        [mutableView refreshImage];

    }
}


你可能感兴趣的:(调用原始相册)