Tuesday, April 23, 2013

UIImage drawAtPoint example ios


drawAtPoint:

Draws the image at the specified point in the current context.
- (void)drawAtPoint:(CGPoint)point
Parameters
point
The point at which to draw the top-left corner of the image.
Discussion of [UIImage drawAtPoint]
This method draws the entire image in the current graphics context, respecting the image’s orientation setting. In the default coordinate system, images are situated down and to the right of the specified point. This method respects any transforms applied to the current graphics context, however.
This method draws the image at full opacity using the kCGBlendModeNormal blend mode.
Example of [UIImage drawAtPoint]

UIGraphicsBeginImageContext(image.size);
[image drawAtPoint:CGPointZero];

NSString *stamp = @"Internal Use Only";
[stamp drawAtPoint:CGPointMake(10, 10) withFont:[UIFont systemFontOfSize:32]];

UIImage *stampedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();