Drawing 2 UIImage on each other
I use following approach to create a frame for a uiimage in my apps.Through this approach it is not necessary to use two separate UIImageViews which means less alive object.This is specially important for for performance issues of custom cells in UItableViews.
+(UIImage*)maskAnImageWithFrame:(UIImage*)originalImage
{
UIImage *frameImage = [UIImage imageNamed:@"Frame.png"];
UIGraphicsBeginImageContext(frameImage.size);
[attachmentImage drawInRect: CGRectMake(0,0, frameImage.size.width, frameImage.size.height)];
[frameImage drawInRect: CGRectMake(0,0, frameImage.size.width, frameImage.size.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
Written by IronLeash
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Uiimageview
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#