如何将一张图片切分成几份
2018-01-10 本文已影响8人
moreFine
方法如下:
CGRect rect = CGRectMake(x,y,w,h); //分割子图的区域
CGImageRef imgRef = CGImageCreateWithImageInRect(image.CGImage, rect);
UIImage *imagePart = [UIImage imageWithCGImage:imgRef];
CGImageRelease(imgRef);
方法如下:
CGRect rect = CGRectMake(x,y,w,h); //分割子图的区域
CGImageRef imgRef = CGImageCreateWithImageInRect(image.CGImage, rect);
UIImage *imagePart = [UIImage imageWithCGImage:imgRef];
CGImageRelease(imgRef);