您的位置:首页 > 移动开发 > IOS开发

IOS两张图片合成为一张图片

2014-10-22 16:08 239 查看
1

- (UIImage *)addImage:(UIImage *)image1 toImage:(UIImage *)image2 {
UIGraphicsBeginImageContext(image1.size);

// Draw image1
[image1 drawInRect:CGRectMake(0, 0, image1.size.width, image1.size.height)];

// Draw image2
[image2 drawInRect:CGRectMake(0, 0, image2.size.width, image2.size.height)];

UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

return resultingImage;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: