Save captured image with image overlay on photo album in iphone

How can I combine the captured photo with UIImagePickerController and viewoverlay? Then I want to save it in the photo album.

Need help with this.

0
source share
3 answers

Sorry, I have not received your question before. One way to do this is to take a screen shot programmatically, and then edit the image according to your requirements and save it.

This should help ... How to take a screenshot programmatically

0
source

I would create an image context and then write both images to it. Then use the UIImageWriteToSavedPhotosAlbum album to save to the album. Here is an example where I put a logo on a saved image when called with a button. In your case, the brand image will be your overlay, and imageToSave will be the image from the UIImagePickerController. Modify to match. Hope this helps:

- (IBAction)saveImage:(id)sender{ //add brand to image UIImage *BrandImage = [UIImage imageNamed:@"brand.png"]; UIImage* imageToSave = [imageView image]; //get current imageView CGSize targetSize = CGSizeMake(self.imageView.image.size.width, self.imageView.image.size.height); CGRect imageRect = CGRectMake(0, 0, self.imageView.image.size.width, self.imageView.image.size.height); //get screen size for retina or non retina UIScreen *MainScreen = [UIScreen mainScreen]; UIScreenMode *ScreenMode = [MainScreen currentMode]; CGSize Size = [ScreenMode size]; //position brand logo according to screen size if (Size.width == 640) { topImageRect = CGRectMake(self.imageView.image.size.width - 160, self.imageView.image.size.height - 80, 141, 53); } else { topImageRect = CGRectMake(self.imageView.image.size.width - 80, self.imageView.image.size.height - 40, 71, 27); } UIGraphicsBeginImageContext(targetSize); CGContextRef context = UIGraphicsGetCurrentContext(); UIGraphicsPushContext(context); [imageToSave drawInRect:imageRect]; [BrandImage drawInRect:topImageRect]; UIGraphicsPopContext(); // get a UIImage from the image context UIImage* SavedImage = UIGraphicsGetImageFromCurrentImageContext(); // clean up drawing environment UIGraphicsEndImageContext(); // Save it to the camera roll / saved photo album UIImageWriteToSavedPhotosAlbum(SavedImage, nil, nil, nil); } 
+3
source

I think this can help work with the camera overlay overview and save the overlay image with the overlay to the library http://red-glasses.com/index.php/tutorials/ios4-take-photos-with-live-video-preview- using-avfoundation /

0
source

All Articles