iOS 截取当前视图

来源:互联网 发布:生物医学数据库 编辑:程序博客网 时间:2024/06/05 09:03

      UIGraphicsBeginImageContext(self.imageBackgroundView.bounds.size);     //currentView 当前的view 创建一个基于位图的图形上下文并指定大小为

      [self.imageBackgroundView.layerrenderInContext:UIGraphicsGetCurrentContext()];//renderInContext呈现接受者及其子范围到指定的上下文

      UIImage *viewImage =UIGraphicsGetImageFromCurrentImageContext();//返回一个基于当前图形上下文的图片

      UIGraphicsEndImageContext();

0 0
原创粉丝点击