iOS 保存第三方摄像头当前播放的图片,获取到图片的路径后,将图片保存到手机本地相册中

#pragma mark 保存到本地相册

– (void)saveHeaderImageWith:(NSString *)path

{

    UIImage *img = [UIImage imageWithContentsOfFile:path];

    [self saveImageToPhotos:img];

}

#pragma mark 保存图片

– (void)saveImageToPhotos:(UIImage*)savedImage

{

    UIImageWriteToSavedPhotosAlbum(savedImage, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);

}

#pragma mark 系统的完成保存图片的方法

– (void)image: (UIImage *) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo

{

    NSString *msg = nil ;

    if (error != NULL) {

        msg = @”保存图片失败” ;

    } else {

        msg = @”保存图片成功” ;

    }

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@”保存图片结果提示” message:msg delegate:self cancelButtonTitle:@”确定” otherButtonTitles:nil];

    [alert show];

}

© 版权声明
THE END
如果内容对您有所帮助,就支持一下吧!
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容