`

将UIView转成UIImage

    博客分类:
  • ios
 
阅读更多

 

#import “QuartzCore/QuartzCore.h”
//把UIView 转换成图片
-(UIImage *)getImageFromView:(UIView *)view{
         UIGraphicsBeginImageContext(view.bounds.size);
         [view.layer renderInContext:UIGraphicsGetCurrentContext()];
         UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
         UIGraphicsEndImageContext();
         return image;
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics