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

- (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截屏图片无损等比例放大)