<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><title>Image scaling</title><Scriptsrc= "Js/modernizr.js"></Script></Head><Body><Scripttype= "Text/javascript">Window.addeventlistener ('Load', eventwindowloaded,false);functioneventwindowloaded () {Canvasapp ();}functionCanvassupport () {returnModernizr.canvas;}functionCanvasapp () {if(!Canvassupport ()) { return; }Else{ varThecanvas=document.getElementById ('Canvas') varContext=Thecanvas.getcontext ("2d")} drawscreen (); functionDrawscreen () {Context.settransform (1,0,0,1,0,0); varx= -; vary= -; varwidth= -; varHeight= -; Context.translate (x+.5*Width,y+.5*height); Context.scale (2,2);//Horizontal, longitudinalContext.fillstyle="Red"; Context.fillrect (-.5*width,-.5*height,width,height); } }</Script><CanvasID= "Canvas"width= "$"Height= "$">your browser is unable to use canvas small white children's shoes; Your support is my greatest pleasure!! </Canvas></Body></HTML>
HTML5 Canvas Zoom Transform