HTML5图片预览需要用到两种方法 1.URL 2.FileReader 直接上代码 !DOCTYPE HTML html head meta charset=utf-8 titlehtml5 图片上传预览/title style #preview { width: 300px; height: 3...
代码如下: var canvas=document.getElementById(canvas); var cxt=canvas.getContext(2d); var img=new Image(); img.src=cat.jpg; cxt.drawImage(img,10,10,490,382...