系统相关
首页 > 系统相关> > iOS加载大量图片出现内存警告而crash掉

iOS加载大量图片出现内存警告而crash掉

作者:互联网

 

 

///绘图显示
-(UIImage*)OriginImage:(UIImage *)image scaleToSize:(CGSize)size
{
    UIGraphicsBeginImageContext(size);  //size 为CGSize类型,即你所需要的图片尺寸
    [image drawInRect:CGRectMake(0, 0, size.width, size.height)];
    UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return scaledImage;   //返回的就是已经改变的图片
}

 

参考:

https://blog.csdn.net/u012198553/article/details/43051005

https://www.cnblogs.com/xm5mao/p/3964701.html

标签:crash,scaledImage,image,iOS,https,CGSize,UIImage,加载,size
来源: https://www.cnblogs.com/qingzZ/p/15246255.html