将UIView转成UIImage

 

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

你可能感兴趣的:(uiimage)