来自 澳门金莎娱乐手机版 2019-11-21 05:05 的文章
当前位置: 金沙澳门官网网址 > 澳门金莎娱乐手机版 > 正文

ios截屏代码,截屏代码

iOS 截屏代码,ios截屏代码

-(UIImage*)getScreenPhoto{

    CGFloat scale = [UIScreen mainScreen].scale;

    NSMutableArray *images = [NSMutableArray array];

    

    CGSize contentSize = self.view.size;

    

    CGSize imageSize = CGSizeMake(contentSize.width * scale, contentSize.height * scale);

    

    UIGraphicsBeginImageContextWithOptions(self.view.size, NO, 0.0);

    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    [images addObject:image];

    

    UIGraphicsBeginImageContext(imageSize);

    

    [images enumerateObjectsUsingBlock:^(UIImage *image, NSUInteger idx, BOOL *stop) {

        [image drawInRect:CGRectMake(0, scale * EJScreenH * idx, EJScreenW * scale, EJScreenH * scale)];

    }];

    UIImage *fullImage = UIGraphicsGetImageFromCurrentImageContext();

    

    UIGraphicsEndImageContext();

  return fullImage;

    

}

截屏代码,ios截屏代码 -(UIImage*)getScreenPhoto{ CGFloat scale = [UIScreen mainScreen].scale; NSMutableArray *images = [NSMutableArray array]; CGSize contentSize = sel...

    [images enumerateObjectsUsingBlock:^(UIImage *image, NSUInteger idx, BOOL *stop) {

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

    NSMutableArray *images = [NSMutableArray array];

    

    

    

    CGFloat scale = [UIScreen mainScreen].scale;

    

    CGSize imageSize = CGSizeMake(contentSize.width * scale, contentSize.height * scale);

    }];

    UIGraphicsEndImageContext();

    [images addObject:image];

        [image drawInRect:CGRectMake(0, scale * EJScreenH * idx, EJScreenW * scale, EJScreenH * scale)];

本文由金沙澳门官网网址发布于澳门金莎娱乐手机版,转载请注明出处:ios截屏代码,截屏代码

关键词: