drawInBezierPath:angle:
指定したベジェパスを帯グラデーションで塗って描画します
-(void)drawInBezierPath:(NSBezierPath *)path: angle:(CGFloat)angle:
解説
指定したベジェパスを帯グラデーションで塗って描画します。
返り値
( void )
なし
引数
( NSBezierPath * )path
( CGFloat )angle
フレームワーク
ApplicationKit
クラス
NSGradient
使用可能
10.5
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSBezierPath *thePath = [NSBezierPath bezierPath]; [thePath moveToPoint:NSMakePoint(20,20)]; [thePath appendBezierPathWithOvalInRect:NSMakeRect(50,50,100,100)]; [thePath appendBezierPathWithOvalInRect:NSMakeRect(20,20,80,80)]; NSGradient *gradient = [[NSGradient alloc] initWithColors: [NSArray arrayWithObjects: [NSColor redColor], [NSColor greenColor], nil ] ]; [theView lockFocus]; [gradient drawInBezierPath: thePath angle: (CGFloat)30.0 ]; [theView unlockFocus]; } @end