UIImage初始化一张图片的方法

A. imageNamed:
B. initWithContentOfFile:
C.[[UIImage alloc] init]
D.imageWithCGImage:scale:orientation








正确答案:D
解析:
imageNamed:系统会检查系统缓存中是否有该名字的Image,如果有的话,则直接返回,如果没有,则先加载图像到缓存,然后再返回

initWithContentsOfFile:系统不会检查系统缓存,而直接从文件系统中加载并返回。

imageWithCGImage:scale:orientation 当scale=1的时候图像为原始大小,orientation制定绘制图像的方向

转载自《猿圈》




[专注待办](https://itunes.apple.com/cn/app/zhuan-zhu-dai-ban-ding-shi/id1103227570?mt=8)

你可能感兴趣的:(UIImage初始化一张图片的方法)