Skip to content

Instantly share code, notes, and snippets.

@tediscript
Created April 2, 2013 12:35
Show Gist options
  • Select an option

  • Save tediscript/5291879 to your computer and use it in GitHub Desktop.

Select an option

Save tediscript/5291879 to your computer and use it in GitHub Desktop.
- (UIImage*) drawImage:(UIImage*) fgImage inImage:(UIImage*) bgImage atPoint:(CGPoint) point {
UIGraphicsBeginImageContextWithOptions(bgImage.size, FALSE, 0.0);
[bgImage drawInRect:CGRectMake( 0, 0, bgImage.size.width, bgImage.size.height)];
[fgImage drawInRect:CGRectMake( point.x, point.y, fgImage.size.width, fgImage.size.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment