Skip to content

Instantly share code, notes, and snippets.

@ashfurrow
Created May 23, 2013 19:56
Show Gist options
  • Save ashfurrow/5638960 to your computer and use it in GitHub Desktop.
Save ashfurrow/5638960 to your computer and use it in GitHub Desktop.
Soft Light Rendering Example
CGImageRef imageRef = CGImageCreateWithImageInRect([rootViewController.gradientImage CGImage], CGRectMake(point.x, self.minY + self.superview.frame.origin.y, size.width, self.maxY - self.minY));
UIImage *img = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
UIGraphicsBeginImageContext(self.backgroundImage.frame.size);
[img drawAtPoint:CGPointZero blendMode:kCGBlendModeSoftLight alpha:1];
[aImage drawAtPoint:CGPointZero blendMode:kCGBlendModeSoftLight alpha:alpha];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.backgroundImage.image = image;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment