зеркало из https://github.com/mozilla/gecko-dev.git
17 строки
396 B
HTML
17 строки
396 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<body>
|
|
<canvas id="canvas" width="100" height="100"></canvas>
|
|
<script>
|
|
var c = document.getElementById("canvas");
|
|
var ctx = c.getContext("2d");
|
|
ctx.fillStyle = "red";
|
|
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
|
|
ctx.globalCompositeOperation = "copy";
|
|
ctx.fillStyle = "green";
|
|
ctx.fillRect(0, 0, 50, 50);
|
|
</script>
|
|
</body>
|
|
</html>
|