Created
November 22, 2015 12:45
-
-
Save anonymous/15eb8f0587e9daa06d1a to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/hekesa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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