Implements drawImage for html image as ImageSource

This commit is contained in:
Diego Marcos 2015-03-25 17:17:18 -07:00
parent 184d214e26
commit 88954e3e18
86 changed files with 1380 additions and 251 deletions

View file

@ -0,0 +1,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(0, 0, sourceWidth, sourceHeight);
destCtx.fillStyle = "#000000";
destCtx.fillRect(5, 5, 40, 40);
</script>
</body>
</html>