HTML canvas arcTo() Yöntemi

❮ HTML Kanvas Referansı

Örnek

Tuval üzerinde iki teğet arasında bir yay oluşturun:

TarayıcınızHTML5tuval etiketini desteklemiyor.

JavaScript:

var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.moveTo(20, 20);           // Create a starting point
ctx.lineTo(100, 20);          // Create a horizontal line
ctx.arcTo(150, 20, 150, 70, 50); // Create an arc
ctx.lineTo(150, 120);         // Continue with vertical line
ctx.stroke();                // Draw it

Tarayıcı Desteği

Tablodaki sayılar, yöntemi tam olarak destekleyen ilk tarayıcı sürümünü belirtir.

Method
arcTo() Yes 9.0 Yes Yes No

Tanım ve Kullanım

arcTo() yöntemi, tuval üzerinde iki teğet arasında bir yay/eğri oluşturur.

Tuval arcto() diyagramı

İpucu: Yayı tuval üzerine gerçekten çizmek için vuruş() yöntemini kullanın .

JavaScript sözdizimi: bağlam .arcTo( x1,y1,x2,y2,r );

Parametre Değerleri

Parameter Description Play it
x1 The x-coordinate of the first tangent
y1 The y-coordinate of the first tangent
x2 The x-coordinate of the second tangent
y2 The y-coordinate of the second tangent
r The radius of the arc

❮ HTML Kanvas Referansı