zoukankan      html  css  js  c++  java
  • 图片保存到相册

    点击按钮,将self.imageView上面的image内容保存到本地相册,并指定判断保存成功与否的方法imageSavedToPhotosAlbum:didFinishSavingWithError:contextInfo:

    - (IBAction)saveImageToAlbum:(id)sender {
        UIImageWriteToSavedPhotosAlbum(self.imageView.image, self, @selector(imageSavedToPhotosAlbum:didFinishSavingWithError:contextInfo:), nil);
    }

    实现imageSavedToPhotosAlbum:didFinishSavingWithError:contextInfo:方法

    - (void)imageSavedToPhotosAlbum:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
    {
        NSString *message = @"呵呵";
        if (!error) {
            message = @"成功保存到相册";
        }else
        {
            message = [error description];
        }
        NSLog(@"message is %@",message);
    }

  • 相关阅读:
    Taxes
    Tennis Championship
    Urbanization
    字符串的匹配
    Alyona and a tree
    Alyona and mex
    Alyona and flowers
    Alyona and copybooks
    Subordinates
    线程的暂停、恢复和终止
  • 原文地址:https://www.cnblogs.com/wskgjmhh/p/4580181.html
Copyright © 2011-2022 走看看