本文介绍了我可以关闭HTML< canvas>元件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在玩元素,绘制线等。
I'm playing around with the <canvas>
element, drawing lines and such.
我注意到我的对角线是抗锯齿的。
I've noticed that my diagonal lines are antialiased. I'd prefer the jaggy look for what I'm doing - is there any way of turning this feature off?
推荐答案
对于这个功能,图片现在有 = false
。
For images there's now context.imageSmoothingEnabled
= false
.
然而,没有什么明确控制线条画。您可能需要使用<$ c $来绘制自己的线条() c> getImageData 和 putImageData
。
However, there's nothing that explicitly controls line drawing. You may need to draw your own lines (the hard way) using getImageData
and putImageData
.
这篇关于我可以关闭HTML< canvas>元件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!