-(UIImage *)MergeTwoImage { UIImage * img =[UIImage imageNamed:@"icon"]; CGSize sz = img.size; UIGraphicsBeginImageContextWithOptions(CGSizeMake(sz.width*2, sz.height), NO, 0); [img drawAtPoint:CGPointMake(0, 0)]; [img drawAtPoint:CGPointMake(sz.width, 0)]; UIImage *mergeImg = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return mergeImg; }
Core Graphics 学习——1 两张图合成为一张图,布布扣,bubuko.com
原文:http://blog.csdn.net/xiaoyuertongxue/article/details/38686519