HTML कैनवास आर्कटो () विधि
उदाहरण
कैनवास पर दो स्पर्शरेखाओं के बीच एक चाप बनाएँ:
जावास्क्रिप्ट:
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
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो पूरी तरह से विधि का समर्थन करता है।
Method | |||||
---|---|---|---|---|---|
arcTo() | 4.0 | 9.0 | 3.6 | 4.0 | Not supported |
परिभाषा और उपयोग
आर्कटो () विधि कैनवास पर दो स्पर्शरेखाओं के बीच एक चाप/वक्र बनाती है।
युक्ति: कैनवास पर वास्तव में चाप खींचने के लिए स्ट्रोक () विधि का उपयोग करें ।
जावास्क्रिप्ट सिंटैक्स: | प्रसंग .arcTo( x1, y1, x2, y2, r ); |
---|
पैरामीटर मान
Parameter | Description | Play it |
---|---|---|
x1 | The x-coordinate of the beginning of the arc | |
y1 | The y-coordinate of the beginning of the arc | |
x2 | The x-coordinate of the end of the arc | |
y2 | The y-coordinate of the end of the arc | |
r | The radius of the arc |
❮ कैनवास वस्तु