Created
November 1, 2012 16:01
-
-
Save akbsteam/3994567 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (UIImage *)backgroundImageWithFrame:(CGRect)frame baseColor:(UIColor *)baseColor { | |
UIImage *colorImage; | |
CGRect bounds = frame; | |
UIGraphicsBeginImageContextWithOptions(frame.size, NO, 0.0f); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
// Fill this path | |
[baseColor setFill]; | |
CGContextAddRect(context, bounds); | |
CGContextFillPath(context); | |
colorImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return colorImage; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment