Created
March 17, 2013 14:44
-
-
Save baobao/e77b6f36ed74c46c408b to your computer and use it in GitHub Desktop.
CoreGraphicsのテストコード
setNeedDisplayメソッドで表示される
This file contains 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
- (void)drawRect:(CGRect)rect | |
{ | |
[super drawRect:rect]; | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetRGBFillColor(context, | |
1.0, 0.5, 0.0, 1.0); | |
CGContextSetRGBStrokeColor(context, | |
1.0, 0.0, 0.5, 1.0); | |
CGContextSetLineWidth(context, 10.0); | |
CGRect r1 = CGRectMake(50.0 , 50.0, 100.0, 100.0); | |
CGContextAddRect(context,r1); | |
CGContextFillPath(context); | |
CGRect r2 = CGRectMake(100.0 , 100.0, 100.0, 100.0); | |
CGContextAddRect(context,r2); | |
CGContextStrokePath(context); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment