/ Published in: Objective C
URL: http://www.drobnik.com/touch/2010/07/drawing-on-uiimages/
Draws a border on an Image Object. Based on the link mentioned above.
Expand |
Embed | Plain Text
- (UIImage *)imageByDrawingBorderOnImage:(UIImage *)image { UIGraphicsBeginImageContext(image.size); [image drawAtPoint:CGPointZero]; CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(ctx, 10); CGContextSetRGBStrokeColor(ctx, 1.000,0.902,0.118, 1.000); CGRect borderRect = CGRectMake(0, 0, image.size.width, image.size.height); CGContextStrokeRect(ctx, borderRect); UIImage *retImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return retImage; }
You need to login to post a comment.
