Nah
0
Q:

javascript canvas

<canvas id="canvas"></canvas>
<script>

	var canvas = document.getElementById('canvas');
    var ctx = canvas.getContext('2d');
  
	ctx.beginPath();
	ctx.rect(x, y, width, height);
  	ctx.fillStyle = 'limegreen';
  	ctx.fill();
  
  	ctx.beginPath();
  	ctx.arc(x, y, radius, startAngle, endAngle, counterClockWise(optional));
  	ctx.strokeStyle = 'black';
  	ctx.stroke();

</script>
0

<canvas id="myCanvas" width="200" height="100"></canvas>
 
2
//Creates a canvas and draws a circle
var canvas = document.body.appendChild(document.createElement("canvas"));
var ctx = canvas.getContext("2d");

ctx.beginPath();
ctx.arc(canvas.width / 2, canvas.height / 2, 50, 0, Math.PI * 2);
ctx.fillStyle = "red";
ctx.strokeStyle = "black";
ctx.stroke();
ctx.fill();
2

 var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");

 ctx.moveTo(0, 0);
ctx.lineTo(200, 100);

 ctx.stroke(); 
1
#this code creates a circle within a canvas that must be created in HTML
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.arc(95, 50, 40, 0, 2 * Math.PI);
ctx.stroke();
2

<canvas id="myCanvas" width="200" height="100"
style="border:1px solid 
#000000;">

</canvas>
 
0
<canvas id="" width="" height=""></canvas>
<script>
	
</script>

<!-- go to chriscourses.com to learn lots -->
-1

New to Communities?

Join the community