NSGradient:initWithStartingColor:endingColor:
Home 目次>ApplicationKit>NSGradient
10.5

initWithStartingColor:endingColor:

開始カラーと終了カラーでグラデーションオブジェクトを初期化して返します


-(id) initWithStartingColor:(NSColor *)startingColor
   endingColor:(NSColor *)endingColor


【返り値】
   idグラデーションオブジェクト(NSGradient)
【パラメータ】
   startingColor開始カラー
   endingColor終了カラー


【解説】

開始カラーと終了カラーでグラデーションオブジェクトを初期化して返します。



【例文】


#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{

NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:[NSColor redColor]
endingColor:[NSColor greenColor]
];
[theView lockFocus];
[gradient drawInRect: NSMakeRect(0,0,100,100) angle:(CGFloat)[theSlider floatValue]];
[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