Created
June 10, 2015 22:18
-
-
Save jordandobson/852c4c6ef5e19966ee1a to your computer and use it in GitHub Desktop.
Objective-c Apply Blending mode to an image
This file contains hidden or 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 *)createDimImage:(UIImage *)image; { | |
CGSize size = image.size; | |
CGRect bounds = CGRectMake(0, 0,size.width, size.height); | |
UIImage * dimImage; | |
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0f); | |
[msColorNeutralLight setFill]; | |
UIRectFill(bounds); | |
[image drawInRect:bounds blendMode:kCGBlendModeMultiply alpha:1.0f]; | |
dimImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return dimImage; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment