scale() メソッド
実行結果
コード
/* 元の円を赤色で描く */ ctx.beginPath(); ctx.arc(25, 50, 20, 0, 2 * Math.PI, false); ctx.strokeStyle = "red"; ctx.stroke(); /* 横に2倍、縦に0.7倍した円を青色で描く */ ctx.beginPath(); ctx.scale(2, 0.7); ctx.arc(25, 50, 20, 0, 2 * Math.PI, false); ctx.strokeStyle = "blue"; ctx.stroke();