Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. CGSize imageSize = [imageView.image size];
  2. CGRect imageExtent = CGRectMake(0,0,imageSize.width,imageSize.height);
  3.  
  4. // Create a context containing the image.
  5. UIGraphicsBeginImageContext(imageSize);
  6. CGContextRef context = UIGraphicsGetCurrentContext();
  7. [imageView.image drawAtPoint:CGPointMake(0, 0)];
  8.  
  9. // Draw the hue on top of the image.
  10. CGContextSetBlendMode(context, kCGBlendModeHue);
  11. [color set];
  12.  
  13. UIBezierPath *imagePath = [UIBezierPath bezierPathWithRect:imageExtent];
  14. [imagePath fill];
  15.  
  16. // Retrieve the new image.
  17. UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
  18. imageView.image= result;
  19.  
  20. UIGraphicsEndImageContext();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement