我想关闭反别名,我相信我需要把shape-rendering设置为"crispEdges“。
我怎样才能用JavaScript做这件事呢?
这是我的代码的一部分,我需要关闭反混叠:
context.strokeStyle = gradient;
context.lineWidth = 1;
context.moveTo(x + size, y + size);
context.lineTo(x + dx, y + dy);
context.stroke();
所以线条应该是右边的,而不是左边的。
每一次帮助都将是非常感谢的!
发布于 2012-07-06 07:18:48
在SVG中,您可以设置“形状呈现”属性,例如:
someElement.style.shapeRendering = "crispEdges";
或作为一种属性:
someElement.setAttribute("shape-rendering", "crispEdges");
HTML5画布无法切换反混叠开关,Ian在这条线中给出了一些原因。
https://stackoverflow.com/questions/11353499
复制相似问题