NSBezierPath:fillRect:
Home 目次>ApplicationKit>NSBezierPath

fillRect:

aRectで塗りつぶし四角形を描画します


+(void) fillRect:(NSRect)aRect


【返り値】
   voidなし
【パラメータ】
   aRect塗る範囲


【解説】

aRectで塗りつぶし四角形を描画します。
現在のカラー(現在のグラフィックスコンテキストに保管されて)で、aRectによって指定される矩形のパスを塗ります。



【例文】


#import "MyView.h"

@implementation MyView

//NSViewのサブクラス MyViewのDrawRectに上書き
-(void)drawRect:(NSRect)rect
{

NSBezierPath *thePath1 = [NSBezierPath bezierPath];
[thePath1 setWindingRule:NSEvenOddWindingRule];

[thePath1 moveToPoint:NSMakePoint(20,20)];

[thePath1 appendBezierPathWithOvalInRect:NSMakeRect(50,50,100,100)];
[thePath1 appendBezierPathWithOvalInRect:NSMakeRect(20,20,80,80)];



[[NSColor redColor] set];
[thePath1 fill];
[[NSColor blueColor] set];
[NSBezierPath fillRect:NSMakeRect(0,0,30,30)];

}

@end


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

Google
Webwww.oomori.com
Apple_Store_40x120

[ad:Usual day in Japan]

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

良い 

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

Home 目次>ApplicationKit>NSBezierPath
修正日2006.12.26