Return to Snippet

Revision: 44249
at April 8, 2011 09:55 by peetj


Initial Code
- (void)drawRect:(CGRect)rect {

        CGContextRef context = UIGraphicsGetCurrentContext();

        CGContextSetLineWidth(context, 2.0);
        CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor);
        CGRect rectangle = CGRectMake(60,170,200,80);
        CGContextAddRect(context, rectangle);
        CGContextStrokePath(context);
        CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor);
        CGContextFillRect(context, rectangle);
}

Initial URL
http://www.techotopia.com/index.php/An_iPhone_Graphics_Drawing_Tutorial_using_Quartz_2D#Drawing_a_Rectangle

Initial Description

                                

Initial Title
Draw rectangle with blue border and fill the rectangular space with red

Initial Tags

                                

Initial Language
Objective C