macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

concat

Index>Foundation>NSAffineTransform

このあとの描画に、変換マトリックスを適用します

解説

このあとの描画に、変換マトリックスを適用します。(NSAffineTransformクラス、10.3までのAppKitから10.4からFoundationに変更)

返り値

( void )

なし

引数

クラス

NSAffineTransform

Instance Methods

使用可能

10.0

参照

- set
- invert

例文

#import "MyView.h"

@implementation MyView

//NSViewのサブクラス MyViewのDrawRectに上書き
-(void)drawRect:(NSRect)rect
{
	
	NSBezierPath *thePath1 = [NSBezierPath bezierPath];
	NSAffineTransform *affin = [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];
	[affin concat];
	[affin concat];
	[affin concat];
	
	
	[thePath1 transformUsingAffineTransform: affin];
	
	[[NSColor redColor] set];
	[thePath1 fill];
	
	
	
	
}

@end