summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/2dcontext/drawing-images-to-the-canvas/drawimage_canvas_3_ref.html
blob: 3e153f1ca651ed6d34f782cf3ffc438f95d85192 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
</head>
<style>
  html, body {
    margin: 0;
  }
  canvas {
    display: block;
  }
</style>
<body>
<canvas id="dest" height="100" width="100"></canvas>
<script type="text/javascript">

var sourceWidth = 50;
var sourceHeight = 50;
var destCanvas = document.getElementById('dest');
var destCtx = destCanvas.getContext('2d');
destCtx.fillStyle = "#FF0000";
destCtx.fillRect(0, 0, destCanvas.width, destCanvas.height);
destCtx.fillStyle = "#00FFFF";
destCtx.fillRect(50, 50, sourceWidth, sourceHeight);
destCtx.fillStyle = "#000000";
destCtx.fillRect(55, 55, 40, 40);

</script>
</body>
</html>