Here’s how to draw from one canvas to another with a 180 degree flip
// save the visibleCtx in it's unrotated state
visibleCtx.save();
// rotate the visible canvas 180 degrees around its centerpoint
visibleCtx.translate(400,300);
visibleCtx.rotate(Math.PI);
visibleCtx.drawImage(c,-400,-300);
// restore the state of visibleCtx to its unrotated state for future drawings
visibleCtx.restore()
Here is code and a Fiddle: http://jsfiddle.net/m1erickson/2scrB/
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="css/reset.css" /> <!-- reset css -->
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<style>
body{ background-color: ivory; padding:10px;}
#c{border:3px solid red;}
#VisibleCanvas{border:3px solid green;}
</style>
<script>
$(function(){
var c=document.getElementById("c");
var cCtx=c.getContext("2d");
var visibleCanvas = document.getElementById("VisibleCanvas");
var visibleCtx = visibleCanvas.getContext("2d");
var img=new Image();
img.onload=function(){
cCtx.drawImage(img,0,0);
// note the image being rotated is 400x234
// so our transformation point is 200x117
visibleCtx.save()
visibleCtx.translate(200,117);
visibleCtx.rotate(Math.PI);
visibleCtx.drawImage(c,-200,-117);
visibleCtx.restore();
}
img.src="https://dl.dropboxusercontent.com/u/139992952/stackoverflow/faces.png";
}); // end $(function(){});
</script>
</head>
<body>
<p>Offscreen</p>
<canvas id="c" width=400 height=234></canvas>
<p>Visible</p>
<canvas id="VisibleCanvas" width=400 height=234></canvas>
</body>
</html>