方法如下:
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);
本文标题:如何将一张图片切分成几份
本文链接:https://www.haomeiwen.com/subject/yubonxtx.html
网友评论