drawInRect:angle:
指定した範囲を帯グラデーションの矩形で描画します
-(void)drawInRect:(NSRect)rect: angle:(CGFloat)angle:
解説
指定した範囲を帯グラデーションの矩形で描画します。
返り値
( void )
なし
引数
( NSRect )rect
( CGFloat )angle
フレームワーク
ApplicationKit
クラス
NSGradient
使用可能
10.5
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSGradient *gradient = [[NSGradient alloc] initWithColors: [NSArray arrayWithObjects: [NSColor redColor], [NSColor greenColor], nil ] ]; [theView lockFocus]; [gradient drawInRect: NSMakeRect(0,0,100,100) angle: (CGFloat)30.0 ]; [theView unlockFocus]; } @end