2011-12-12 3 views
-4

내 앱에서 많은 이미지 작업을하고 있습니다. 저장 버튼에 사진 라이브러리에 그 perticular 이미지를 저장하고 싶습니다. 어떻게해야합니까? 너는 어떤 생각을 가지고 있니? 예 다음 PLZ 나에게 코드 .. 사전에아이폰 - 버튼 클릭 이미지는 사진 라이브러리에 저장해야합니다.

고맙습니다 ..

+0

가능한 중복 [아이폰 사진 라이브러리에 사진을 저장하는 방법?] (http://stackoverflow.com/questions/178915/how-to-save-picture-to-iphone-photo-library) –

답변

2

에 이미지를 저장합니다.

UIImageWriteToSavedPhotosAlbum(yourImage, nil, nil, nil); 
1

를 제공하는 경우 사진 라이브러리에 저장할 수있는 몇 가지 방법이 있습니다. 이것을 처리하는 가장 현대적인 방법은 ALAssetsLibrary을 사용하는 것입니다. 방법은 아래

CGImageRef imageRef = myUIImage.CGImage; 
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; 

[library writeImageToSavedPhotosAlbum:imageRef orientation:(ALAssetOrientation)UIImageOrientationUp completionBlock:^(NSURL *assetURL, NSError *error){ 

    //do whatever you wish at the conclusion of the save. 
    } 

}]; 
1

사용 앨범이 장치의 사진 앨범에 이미지를 저장하는 데 도움이

UIImageWriteToSavedPhotosAlbum(imageobj, nil, nil, nil); 
관련 문제