资源:两张6M大小的图像。
过程:合并两个图像
结果:获取2300万尺寸的图像
问题:
这是我的代码:
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef contextRef = CGBitmapContextCreate(_bytes, width, height, 8, 4 * width, colorSpace, kCGImageAlphaPremultipliedLast);
CGColorSpaceRelease(colorSpace);
// CGContextSetInterpolationQuality(contextRef, 1);
NSInteger currentHeight = 0;
for (int i = 0; i<count; i++) {
UIImage *tempImage = [UIImage imageWithContentsOfFile:_imageList[i]];
NSInteger tempHeight = tempImage.size.height * width / tempImage.size.width;
CGContextDrawImage(contextRef, CGRectMake(0, currentHeight, width, tempHeight), tempImage.CGImage);
currentHeight += tempHeight;
}
CGImageRef imageRef = CGBitmapContextCreateImage(contextRef);
UIImage *result = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
CGContextRelease(contextRef);