scaleXBy:yBy:
Index>Foundation>NSAffineTransform
原点を中心に座標の拡大縮小をセットします
-(void)scaleXBy:(float)scaleX: yBy:(float)scaleY:
解説
原点を中心に座標の拡大縮小をセットします。
scaleX X方向の倍率
scaleY Y方向の倍率
(NSAffineTransformクラス、10.3までのAppKitから10.4からFoundationに変更)
返り値
( void )
なし
引数
( float )scaleX
X方向の倍率(1.0が等倍)
( float )scaleY
Y方向の倍率(1.0が等倍)
フレームワーク
Foundation
クラス
NSAffineTransform
Instance Methods
使用可能
10.0
参照
- rotateByDegrees:
- rotateByRadians:
- scaleBy:
- translateXBy:yBy:
例文
#pragma mark -scaleXBy:yBy: - (IBAction)method006:(id)sender { //make bezier path NSBezierPath *thePath1 = [NSBezierPath bezierPath]; //make affin transform NSAffineTransform *affin = [NSAffineTransform transform]; //focus window's view [_window.contentView lockFocus]; //clear window NSRect rect = [_window.contentView frame ]; [[NSColor windowBackgroundColor] set]; NSRectFill(rect); //set winding rule [thePath1 setWindingRule:NSEvenOddWindingRule]; //move pen [thePath1 moveToPoint:NSMakePoint(20,20)]; //make path [thePath1 appendBezierPathWithOvalInRect:NSMakeRect(50,50,100,100)]; [thePath1 appendBezierPathWithOvalInRect:NSMakeRect(20,20,80,80)]; //set color [[NSColor blueColor] set]; //fill path [thePath1 fill]; //set transform [affin scaleXBy:1.5 yBy:3.0]; [thePath1 transformUsingAffineTransform: affin]; //set color [[NSColor redColor] set]; [thePath1 fill]; //unlock focus [_window.contentView unlockFocus]; [_window.contentView displayIfNeeded]; }