网络请求图片,根据范围取图

2016-11-25  本文已影响16人  呦嚯嚯嚯12138

CGImageRef temImg = image.CGImage;

float width = CGImageGetWidth(temImg);

float height = CGImageGetHeight(temImg);

temImg = CGImageCreateWithImageInRect(temImg, CGRectMake(width * 0.5 - height * 0.5, 0, height, height));

//得到新的图片

UIImage *new = [UIImage imageWithCGImage:temImg];

shopImage.image = new;

上一篇 下一篇

猜你喜欢

热点阅读