This commit is contained in:
Adrian Hinz 2016-10-28 10:03:03 +02:00
parent 4c0e26420e
commit a811b68e46
1 changed files with 28 additions and 0 deletions

28
gra.html Normal file
View File

@ -0,0 +1,28 @@
<!-- Learn about this code on MDN: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_usage -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<script type="application/javascript">
function draw() {
var canvas = document.getElementById("canvas");
if (canvas.getContext) {
var ctx = canvas.getContext("2d");
ctx.fillStyle = "rgb(200,0,0)";
ctx.fillRect (250, 10, 50, 50);
ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
ctx.fillRect (230, 30, 50, 50);
ctx.fillRect(25,25,100,100);
ctx.clearRect(45,45,60,60);
ctx.strokeRect(50,50,50,50);
}
}
</script>
</head>
<body onload="draw();">
<canvas id="canvas" width="640" height="480" style="border: 1px solid black;"></canvas>
</body>
</html>