Created
          February 13, 2010 20:29 
        
      - 
      
- 
        Save coreyfloyd/303661 to your computer and use it in GitHub Desktop. 
  
    
      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* bottomImage = [UIImage imageNamed:@"bottom.png"]; | |
| UIImage* topImage = [UIImageNamed:@"top.png"]; | |
| UIImageView* imageView = [[UIImageView alloc] initWithImage:bottomImage]; | |
| UIImageView* subView = [[UIImageView alloc] initWithImage:topImage]; | |
| subView.alpha = 0.5; // Customize the opacity of the top image. | |
| [imageView addSubview:subView]; | |
| UIGraphicsBeginImageContext(imageView.frame.size); | |
| [imageView.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
| UIImage* blendedImage = UIGraphicsGetImageFromCurrentImageContext(); | |
| UIGraphicsEndImageContext(); | |
| [subView release]; | |
| [imageView release]; | |
| [self doWhateverIWantWith: blendedImage]; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment