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