taiyang2014

图片合成截屏

-(UIImage *)saveImage:(UIView *)view {
    CGRect mainRect = [[UIScreen mainScreen] bounds];
   
    UIGraphicsBeginImageContext(CGSizeMake(320, 200));
    CGContextRef context = UIGraphicsGetCurrentContext();
    //    [[UIColor blackColor] set];
   
    CGContextFillRect(context, mainRect);
    [view.layer renderInContext:context];
   
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
   
    UIGraphicsEndImageContext();
   
    return newImage;
}

posted on 2015-12-04 17:07  taiyang2014  阅读(161)  评论(0编辑  收藏  举报

导航