저는 아이폰 장치 사진 라이브러리에 캡처 한 이미지를 저장해야하는 프로젝트 중 하나에서 작업하고 있습니다.저장 방법 아이폰 장치 사진 라이브러리에 카메라에서 이미지 캡처?
- - (무효) imagePickerController : (UIImagePickerController를 *) 선택 도구 didFinishPickingMediaWithInfo : (NSDictionary와 *) 정보 {
나는 내 코드를 붙여 해요 아래 code.Here를 통해이를 구현하는 방법을 물어보고 싶은 무엇
[picker dismissModalViewControllerAnimated:YES];
imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
imgglobal =imageView.image;
NSString *newFilePath = [NSHomeDirectory() stringByAppendingPathComponent: @"~/Users/abc/Library/Application Support/iPhone Simulator/User/Applications/SAVE_IMAGE_TEST1.JPG"];
NSData *imageData = UIImageJPEGRepresentation(imageView.image, 1.0);
NSData *data = imageData;
if (imageData != nil) {
[imageData writeToFile:newFilePath atomically:YES];
}
if ([[NSFileManager defaultManager] createFileAtPath:@"~/Users/abc/Library/Application Support/iPhone Simulator/User/Applications/SAVE_IMAGE_TEST1.JPG" contents:data attributes:nil])
{
UIAlertView *successAlert = [[UIAlertView alloc] initWithTitle:@"Success" message:@"Image was successfully saved to the Photo Library." delegate:self cancelButtonTitle:@"Close" otherButtonTitles:nil];
[successAlert show];
[successAlert release];
} else {
UIAlertView *failureAlert = [[UIAlertView alloc] initWithTitle:@"Failure" message:@"Failed to save image to the Photo Library." delegate:self cancelButtonTitle:@"Close" otherButtonTitles:nil];
[failureAlert show];
[failureAlert release];
}
}
하지만 내 응용 프로그램 쇼 오류 경고 나에게 아이폰 장치의 사진 라이브러리로 캡처 한 이미지를 저장 할 수있는 권리 코드를 보내 주시기 바랍니다. 사전에
감사의 그것은 (오류 처리를 계산하지 않음) 한 줄의
@ AmanGupta007 같은 문제에 직면 해 있습니다. 어떻게 가능합니까? –