Home  >  Article  >  Web Front-end  >  关于html5 canvas_html/css_WEB-ITnose

关于html5 canvas_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:13:531008browse

var pic = new Image(); 
pic.src = "feather_default.jpg"; 
context2D.translate(0,0);
context2D.drawImage(pic,0,0);
在不设定画布大小的时候 为什么永远都是 300*150 的?
在设定画布大小为任意大小 var data = canvas.toDataURL(); 获取图片永远也是300*150 的怎么回事?
求高手指教


回复讨论(解决方案)

gang刚才在微博看见你了 哈哈这里又看见你了  

gang刚才在微博看见你了 哈哈这里又看见你了  解决了~~谢谢~~

那个昨天我测试了 不知道你是怎么设置的  你如果直接在canvas上面设置width 和height  能够获取实际的值,如果你用css也可以获取 可能是你的方法错了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn