<canvas id="canvas"></canvas>
<script type="text/JavaScript">
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// void ctx.rotate(angle);
// ctx.fillRect(x,y,width,height);
ctx.rotate(45 * Math.PI / 180);
ctx.fillRect(70, 30, 120, 40);
</script>