drawInBezierPath:relativeCenterPosition:
指定したベジェパスを円グラデーションで塗って描画します
-(void)drawInBezierPath:(NSBezierPath *)path: relativeCenterPosition:(NSPoint)relativeCenterPosition:
解説
指定したベジェパスを円グラデーションで塗って描画します。
返り値
( void )
なし
引数
( NSBezierPath * )path
描画するベジエパス
( NSPoint )relativeCenterPosition
関連する円の中心点
フレームワーク
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 relativeCenterPosition: NSMakePoint(0,1) ]; [theView unlockFocus]; } @end