Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8552861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:31:18+00:00 2026-06-11T14:31:18+00:00

I am going straight to the point,my problem is, I have a uiview controller

  • 0

I am going straight to the point,my problem is, I have a uiview controller which is taking 3 buttons and a uiimage view.Now,

  1. When i am pressing first button i am taking image from iphone default photo gallery and placing on uiimageview.

  2. When i am pressing second button it will take another image from photo gallery and placing on previous image.

  3. Now when i will press third button those two image will add and make it one image and save in the photo album.

i have done step 1 and step 2 but how can i do step 3??

EDIT

suppose a man without beard in a picture(image1) but i am adding another beard image(image2) to make an image where he will look like beard man(image3). i want to save image 3 in photo album.

Thanks In Advance for any help..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:31:20+00:00Added an answer on June 11, 2026 at 2:31 pm

    myself also having same issue previously i solved this way

    try this category code….

    .h file:

    #import <UIKit/UIKit.h>
    
    @interface UIImage (MyImage)
    
    
    + (UIImage*)imageFromView:(UIView*)view;
    + (UIImage*)imageFromView:(UIView*)view scaledToSize:(CGSize)newSize;
    + (UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize;
    + (void)beginImageContextWithSize:(CGSize)size;
    + (UIImage *)croppedImage:(UIImage *)myImage :(CGRect)bounds;
    
    //masking the image ....
    
    + (UIImage*) maskImage:(UIImage *)image withMask:(UIImage *)maskImage;
    
    @end
    

    .m file:

    #import "UIImage+MyImage.h"
    
    @implementation UIImage (MyImage)
    
    + (void)beginImageContextWithSize:(CGSize)size
    {
        if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
            if ([[UIScreen mainScreen] scale] == 2.0) {
                UIGraphicsBeginImageContextWithOptions(size, YES, 2.0);
            } else {
                UIGraphicsBeginImageContext(size);
            }
        } else {
            UIGraphicsBeginImageContext(size);
        }
    }
    
    + (void)endImageContext
    {
        UIGraphicsEndImageContext();
    }
    
    + (UIImage*)imageFromView:(UIView*)view
    {
        [self beginImageContextWithSize:[view bounds].size];
        BOOL hidden = [view isHidden];
        [view setHidden:NO];
        [[view layer] renderInContext:UIGraphicsGetCurrentContext()];
        UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
        [self endImageContext];
        [view setHidden:hidden];
        return image;
    }
    
    + (UIImage*)imageFromView:(UIView*)view scaledToSize:(CGSize)newSize
    {
        UIImage *image = [self imageFromView:view];
        if ([view bounds].size.width != newSize.width ||
            [view bounds].size.height != newSize.height) {
            image = [self imageWithImage:image scaledToSize:newSize];
        }
        return image;
    }
    
    + (UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize
    {
        [self beginImageContextWithSize:newSize];
        [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
        UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
        [self endImageContext];
        return newImage;
    }
    
    
    + (UIImage *)croppedImage:(UIImage *)myImage :(CGRect)bounds {
        CGImageRef imageRef = CGImageCreateWithImageInRect(myImage.CGImage, bounds);
        UIImage *croppedImage = [UIImage imageWithCGImage:imageRef];
        CGImageRelease(imageRef);
        CGSize asd =  croppedImage.size;
        return croppedImage;
    }
    
    
    
    
    + (UIImage*) maskImage:(UIImage *)image withMask:(UIImage *)maskImage {
    
        CGImageRef maskRef = maskImage.CGImage; 
    
        CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(maskRef),
                                            CGImageGetHeight(maskRef),
                                            CGImageGetBitsPerComponent(maskRef),
                                            CGImageGetBitsPerPixel(maskRef),
                                            CGImageGetBytesPerRow(maskRef),
                                            CGImageGetDataProvider(maskRef), NULL, false);
    
        CGImageRef masked = CGImageCreateWithMask([image CGImage], mask);
    
        CGImageRelease(mask);
        CGImageRelease(maskRef);
        return [UIImage imageWithCGImage:masked];
    
    }
    
    
    
    @end
    

    my design will be view(named as combinedView) that contains two image view one is just the source image[i.e man without beard] on the top of that image i am having beard image…

    then i make the image by this way….

    UIImage *myMaskedImage=[UIImage imageFromView:combinedView ];
    

    for saving this to album use this…

     UIImageWriteToSavedPhotosAlbum(myMaskedImage, self, nil, nil);
    

    try this idea….

    New Update:
    this structure you need to maintain and also theView‘s background color as clear color

                  +theView ---
                     |
                     ->imageview1(person)
                     |
                     ->imageView2(beard alone)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Going straight to the point, i have made a code to test concurrency in
Going mad now. I have a MVC solution that i've upgraded from MVC 1
Good afternooon everyone, i'll go straight to the point. I have this code at
I decided not to use an orm and going to use straight ADO.NET for
Going through happstack-lite tutorial : we build functions that have return type of ServerPart
going thru a tutorial on python lists,I tried to write a python function which
Going round in circles here i think. I have an activity called Locate; public
Going through the microsoft authentication tutorial listed here they have you create a master
I'm done some WinForms work in C# but now moving to have to develop
I'm stuck with this problem I have a serie of pages of the CharacterView

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.