关于html5 canvas_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:13:53
Original
1007 people have browsed it

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也可以获取 可能是你的方法错了

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!