简体   繁体   English

HTML5画布和缩放

[英]HTML5 Canvas and scaling

After I draw a line on canvas I scale document (with CTRL+Wheel), as it turned out, a line is raster and it looks pretty ugly after scaling. canvas上绘制一条线后,我缩放文档(使用CTRL + Wheel),结果显示,一条线是光栅,缩放后看起来很难看。 How can I solve the issue? 我该如何解决这个问题? Is there something better then redrawing each time when document is scaled? 每次缩放文档时,有没有比重绘更好的东西?

Thank you in advance! 先感谢您!

If you can only use the canvas element, there is no other way to display a sharp line, than redrawing it when zooming. 如果只能使用canvas元素,则没有其他方法可以显示锐利线,而不是在缩放时重绘它。 This is because the canvas doesn't support vector graphics. 这是因为画布不支持矢量图形。

Svg could be a option, if you're able to use a different technology. 如果你能够使用不同的技术, Svg可能是一个选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM