using 2 UIImageView in you interface, after using the UIImagePicker for each, you can marge with this code:
- (IBAction)margeSave:(id)sender{
//here you get you two different image
UIImage *bottomImage = self.imageViewPick.image;
UIImage *image = self.myImage.image;
//here you have to crop each image with the code below
//using here a crop code and adjust for your Image
// create a new size for a merged image
CGSize newSize = CGSizeMake(640, 640);
UIGraphicsBeginImageContext( newSize );
[bottomImage drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
[myImage drawInRect:CGRectMake(0,0,newSize.width,newSize.height) blendMode:kCGBlendModeNormal alpha:1.0];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(newImage, nil, nil, nil);
//option if you are in other view when save
//[self.navigationController popViewControllerAnimated:YES];
}
You can integrate this code to crop a image:
in InterfaceBuilder using 2 part of image for picking with the specific size you want, for example on iPhone using 2 UIImageView
W:150 H:300
total il a 300x300
and using a crop image with size.
CGRect clippedRect = CGRectMake(self.view.frame.origin.x+91, self.view.frame.origin.y, self.view.frame.size.width-91*2, self.view.frame.size.height-220);
CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], clippedRect);
UIImage *imageCrop = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
Hope this help you