While researching about image manipulation for my next project, I came across an interesting piece of code, using which, we can merge two images into a single image. Here's the code:
-(UIImage*)mergeImage:(UIImage*)mask overImage:(UIImage*)source inSize:(CGSize)size
{
//Capture image context ref
UIGraphicsBeginImageContext(size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//Draw images onto the context
[source drawInRect:CGRectMake(0, 0, source.size.width, source.size.height)];
[mask drawInRect:CGRectMake(0, 0, mask.size.width, mask.size.height)];
return viewImage;
}
Got the reference from here.
Enjoy!
Subscribe to:
Post Comments (Atom)
Blog Archive
-
►
2008
(15)
-
►
May
(9)
- Competition for MacBook Air
- If you are willing to work
- Some Libraries in JavaScript
- Utility function to get current X and Y position o...
- Utility Class to change local time in GMT and GMT ...
- Interesting Javascript functions
- How to make an image draggable (Google Map Type)
- Life is interesting
- Speed optimization in ASP .Net web applications
-
►
May
(9)
Popular Posts
-
In iPad, we have a new control called UIPopover. This control shows up as an overlay in the screen with a UIViewController or UIView in it. ...
-
Today I came across a unique problem. I was working on a Drupal website for one of my clients and there I was required to create a page to s...
-
/*-------This works for IE and non IE as well----------------*/ var oScript = document.createElement("script"); oScript.src = fileName.js; d...
-
A lot of time I came across a common problem of showing background image in navigation bar of iPhone application. For very first time, I use...
-
While researching about image manipulation for my next project, I came across an interesting piece of code, using which, we can merge two im...
Topics
asp .net
(3)
c#
(2)
Drupal
(3)
How To
(6)
iPhone
(10)
java
(1)
javascript
(8)
laptop
(1)
Life Style
(2)
linux
(1)
logout
(1)
New Technologies
(1)
optimization
(1)
PHP
(2)
planning
(1)
Recession
(1)
resource
(1)
reviews
(1)
secure download
(1)
SEO
(1)
servlet
(1)
skills
(1)
success
(1)
tips
(3)
tutorial
(2)
UIWebView
(1)
Utilities
(4)
web development
(2)
Web technology
(1)
website
(1)
0 comments:
Post a Comment
Tweet