Skip to content

Instantly share code, notes, and snippets.

Created November 22, 2015 12:45
Show Gist options
  • Save anonymous/15eb8f0587e9daa06d1a to your computer and use it in GitHub Desktop.
Save anonymous/15eb8f0587e9daa06d1a to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/hekesa
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<canvas id="graphic">
description
</canvas>
<script id="jsbin-javascript">
var canvas = document.querySelector('#graphic');
var dpi = window.devicePixelRadio;
canvas.setAttribute("width", 800*dpi);
canvas.setAttribute("height", 600*dpi);
var ctx = canvas.getContext('2d');
ctx.fillStyle = "red";
ctx.fillRect(40,20,100,100);
</script>
<script id="jsbin-source-javascript" type="text/javascript">var canvas = document.querySelector('#graphic');
var dpi = window.devicePixelRadio;
canvas.setAttribute("width", 800*dpi);
canvas.setAttribute("height", 600*dpi);
var ctx = canvas.getContext('2d');
ctx.fillStyle = "red";
ctx.fillRect(40,20,100,100);</script></body>
</html>
var canvas = document.querySelector('#graphic');
var dpi = window.devicePixelRadio;
canvas.setAttribute("width", 800*dpi);
canvas.setAttribute("height", 600*dpi);
var ctx = canvas.getContext('2d');
ctx.fillStyle = "red";
ctx.fillRect(40,20,100,100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment