Last active
December 7, 2018 04:01
-
-
Save baobao/6ed343edd8ca7fa4630e to your computer and use it in GitHub Desktop.
CoreGraphicsテスト2
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 | |
{ | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
//塗りつぶしカラーを選択 | |
CGContextSetRGBFillColor(context, 100, 0, 30, 1); | |
//ラインのカラーを選択 | |
CGContextSetRGBStrokeColor(context, 255, 255, 255, 1); | |
UIBezierPath *path = [UIBezierPath bezierPath]; | |
path.lineWidth = 4; | |
[path moveToPoint:CGPointMake(160, 20)]; | |
[path addLineToPoint:CGPointMake(260, 340)]; | |
[path addArcWithCenter:CGPointMake(160, 340) radius:100 startAngle:0 endAngle:M_PI clockwise:YES]; | |
[path closePath]; | |
[path fill]; | |
[path stroke]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment