首页 > 移动平台 > 详细

iOS中的截屏

时间:2015-09-30 23:20:25      阅读:457      评论:0      收藏:0      [点我收藏+]

 

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

    UIGraphicsBeginImageContextWithOptions(self.view.frame.size, YES, 0.0);

    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];

    UIImage* image = UIGraphicsGetImageFromCurrentImageContext();

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

}

 

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

{

    NSLog(@"保存结束");

}

 

 

技术分享

iOS中的截屏

原文:http://www.cnblogs.com/iOS771722918/p/4850417.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!