set
レシーバーの変換マトリックスに現在の変換マトリックスをセットします
解説
レシーバーの変換マトリックスに現在の変換マトリックスをセットします。
(NSAffineTransformクラス、10.3までのAppKitから10.4からFoundationに変更)
返り値
( void )
なし
引数
フレームワーク
Foundation
クラス
NSAffineTransform
Instance Methods
使用可能
10.0
参照
例文
#import "MyView.h" @implementation MyView //NSViewのサブクラス MyViewのDrawRectに上書き -(void)drawRect:(NSRect)rect { //初期設定 int i; NSBezierPath *thePath1 = [NSBezierPath bezierPath]; NSAffineTransform *affin = [NSAffineTransform transform]; //描画開始点に移動 [thePath1 moveToPoint:NSMakePoint(100,100)]; //●を記述 [thePath1 appendBezierPathWithOvalInRect:NSMakeRect(100,100,2,2)]; //色をブルーに [[NSColor blueColor] set]; //塗る [thePath1 fill]; [affin rotateByDegrees:1.0]; for (i=1;i<360;i++){ //変換を記述 [affin set]; //変換 [thePath1 transformUsingAffineTransform: affin]; //塗る [thePath1 fill]; } } @end