Skip to content

Instantly share code, notes, and snippets.

@thiagopintodev
Created February 25, 2012 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiagopintodev/1910239 to your computer and use it in GitHub Desktop.
Save thiagopintodev/1910239 to your computer and use it in GitHub Desktop.
<style>
body {
margin: 0px;
padding: 0px;
}
#myCanvas {
border: 1px solid red;
width: 99.9%;
height: 1000px;
}
</style>
<canvas id="myCanvas" width="578" height="200">
</canvas>
<script>
window.onload = function() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
context.lineWidth = 1;
context.lineCap = "round";
context.strokeStyle = 'red';
context.moveTo(40, 70);
context.lineTo(400, 20);
context.stroke();
context.strokeStyle = 'green';
context.moveTo(315, 0);
context.lineTo(167, 10);
context.stroke();
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment