+ (UIImage*)mergeImage:(UIImage*)firstImage withImage:(UIImage*)secondImage {
CGImageReffirstImageRef = firstImage.CGImage;
CGFloatfirstWidth =CGImageGetWidth(firstImageRef);
CGFloatfirstHeight =CGImageGetHeight(firstImageRef);
CGImageRefsecondImageRef = secondImage.CGImage;
CGFloatsecondWidth =CGImageGetWidth(secondImageRef);
CGFloatsecondHeight =CGImageGetHeight(secondImageRef);
CGSizemergedSize =CGSizeMake(MAX(firstWidth, secondWidth),MAX(firstHeight, secondHeight));
UIGraphicsBeginImageContext(mergedSize);
[firstImagedrawInRect:CGRectMake(0,0, firstWidth, firstHeight)];
[secondImagedrawInRect:CGRectMake(0,0, secondWidth, secondHeight)];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
returnimage;
}