简体   繁体   中英

Phonegap (cordova) save image to custom album

I do not know much about Objective-C . I need to save the image in the gallery to custom name album and i used Canvas2ImagePlugin but image save to album camera roll.

Canvas2ImagePlugin using:

UIImage* image = [[[UIImage alloc] initWithData:imageData] autorelease];    
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);

How to use the name album in the function UIImageWriteToSavedPhotosAlbum ? Or use another function?

Actually i don't know about phonegap . but i can give you hint that how we can achieved in ios . with help of ALAssetsLibrary , we can stored photo to custom album.

 [self.library saveImage:image toAlbum:@"Touch Code Magazine" withCompletionBlock:^(NSError *error) {
    if (error!=nil) {
        NSLog(@"Big error: %@", [error description]);
    }
   }]; 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM