tracy-e

iphone程序中实现截屏的一种方法

2010-10-11 11:15  Tracy E  阅读(455)  评论(0编辑  收藏  举报

在iphone程序中实现截屏的一种方法:

//导入头文件
#import <QuartzCore/QuartzCore.h>
 

//将整个self.view大小的图层内容创建一张图片image
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layerrenderInContext:UIGraphicsGetCurrentContext()];
UIImage*image= UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

//然后将该图片保存到图片图
UIImageWriteToSavedPhotosAlbum(image, self, nil, nil);

分类:

技术点:

相关文章:

  • 2021-09-06
  • 2022-02-08
  • 2021-08-02
  • 2021-10-08
  • 2022-01-06
  • 2021-12-05
猜你喜欢
  • 2022-01-02
  • 2022-01-03
  • 2022-02-09
  • 2022-02-09
相关资源
相似解决方案