NSGradient:drawInBezierPath:relativeCenterPosition:
Home 目次>ApplicationKit>NSGradient
10.5

drawInBezierPath:relativeCenterPosition:

指定したベジェパスを円グラデーションで塗って描画します


-(void) drawInBezierPath:(NSBezierPath *)path
   relativeCenterPosition:(NSPoint)relativeCenterPosition


【返り値】
   voidなし
【パラメータ】
   path描画するベジエパス
   relativeCenterPosition関連する円の中心点


【解説】

指定したベジェパスを円グラデーションで塗って描画します。



【例文】


#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


(C) 2000-2007 Satoshi Oomori.
[Apple]

Google
Webwww.oomori.com
Apple_Store_40x120

[ad:Usual day in Japan]

この記事を評価してください。 

良い 

間違いがある 説明がわかりにくい 例文がわかりにくい  

Home 目次>ApplicationKit>NSGradient
修正日2006.12.26