as per my title, i have a 2 picture which i will like to save it as one photo.
one of the photo allow user to gesture such as rotate, zoom and move around.
how do i save user moved and rotated picture ?
screen shot of the phone saved image
the code below are referred from How to combine/ merge 2 images into 1
UIImage *image = nil;
CGSize newImageSize = CGSizeMake(cropImage.frame.size.width, cropImage.frame.size.height);
if (UIGraphicsBeginImageContextWithOptions != NULL) {
UIGraphicsBeginImageContextWithOptions(newImageSize, NO, [[UIScreen mainScreen] scale]);
} else {
UIGraphicsBeginImageContext(newImageSize);
}
// Draw image1
[maskImage.image drawInRect:CGRectMake(0,0, maskImage.frame.size.width,maskImage.frame.size.height)];
// Draw image2
[cropImage.image drawInRect:CGRectMake(cropImage.frame.origin.x, cropImage.frame.origin.y, cropImage.frame.size.width, cropImage.frame.size.height)];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;