Reputation: 3432
I want to get the following result with two images.
Please help me.
Upvotes: 1
Views: 2049
Reputation: 38249
After @Sumanth's code for combine two images you need to mask final image like how-to-mask-an-image link
Upvotes: 3
Reputation: 4921
To combine two images on an image view try this
UIImage *bottomImage = [UIImage imageNamed:@"bottom.png"]; //background image
UIImage *image = [UIImage imageNamed:@"top.png"]; //foreground image
CGSize newSize = CGSizeMake(width, height);
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:0.8];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Add newImage
to UIImageView
Upvotes: 3