prependTransform:
Index>Foundation>NSAffineTransform
レシーバの変換マトリックスの前に別の変換マトリックスを加えて、結果を返します
-(void)prependTransform:(NSAffineTransform *)aTransform:
解説
レシーバの変換マトリックスの前に別の変換マトリックス(aTransform)を加えて、その結果を返します。
(NSAffineTransformクラス、10.3までのAppKitから10.4からFoundationに変更)
返り値
( void )
なし
引数
( NSAffineTransform * )aTransform
前に付加する変換マトリックス
フレームワーク
Foundation
クラス
NSAffineTransform
Instance Methods
使用可能
10.0
参照
- appendTransform:
例文
#import "MyView.h" @implementation MyView -(void)drawRect:(NSRect)rect { NSBezierPath *thePath1 = [NSBezierPath bezierPath]; NSAffineTransform *affin = [NSAffineTransform transform]; NSAffineTransform *affin2 = [NSAffineTransform transform]; [thePath1 setWindingRule:NSEvenOddWindingRule]; [thePath1 moveToPoint:NSMakePoint(20,20)]; [thePath1 appendBezierPathWithOvalInRect:NSMakeRect(50,50,100,100)]; [thePath1 appendBezierPathWithOvalInRect:NSMakeRect(20,20,80,80)]; [[NSColor blueColor] set]; [thePath1 fill]; [affin translateXBy: 10.0 yBy: 10.0]; [affin2 translateXBy: 10.0 yBy: 10.0]; [affin prependTransform:affin2]; [thePath1 transformUsingAffineTransform: affin]; [[NSColor redColor] set]; [thePath1 fill]; } @end