| 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
![]() | |
この記事を評価してください。
| Home 目次>ApplicationKit>NSBezierPath | 修正日2006.12.26 |