UIImage Merging two images

January 26, 2014   ·   0 Comments

-(void) UIImage_Merging_two_images{
    
    UIImage *bottomImage = [UIImage imageNamed:@"a1.png"]; //background image
    UIImage *image       = [UIImage imageNamed:@"a2.png"]; //foreground image
    
    CGSize newSize = CGSizeMake(320, 480);
    UIGraphicsBeginImageContext( newSize );
    
    // Use existing opacity as is
    [bottomImage drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
    
    // Apply supplied opacity if applicable
    [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height) blendMode:kCGBlendModeNormal alpha:1];
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
    
    UIGraphicsEndImageContext();
    
    UIImageView* resultView = [[UIImageView alloc] initWithImage:newImage];
    resultView.frame = CGRectMake(0, 0,320,460);
    [self.view addSubview:resultView];
    
}

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
iOS Tutorial9

Amazon

adsbygoogle

Recent Posts

Categories

Amazon