美文网首页
当前view截屏图片无损等比例放大

当前view截屏图片无损等比例放大

作者: 哭泣的琉璃贝 | 来源:发表于2017-03-26 20:19 被阅读57次
- (UIImage*) getSavedImage
    {
    UIGraphicsBeginImageContext(CGSizeMake(720, 960));
    CGContextRef context = UIGraphicsGetCurrentContext();
    NSLog(@"%@", NSStringFromCGRect(self.frame));
    
    //    self.layer.shouldRasterize = YES;
    //    self.layer.rasterizationScale = 3;
    
    CGContextScaleCTM(context, 3, 3);
    [self.layer renderInContext:UIGraphicsGetCurrentContext()];
    
    
    UIImage *image=UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return image;
    }

相关文章

网友评论

      本文标题:当前view截屏图片无损等比例放大

      本文链接:https://www.haomeiwen.com/subject/qqgkottx.html