Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Graphics SVG/Canvas::shape rendering=";crispEdges“;通过JavaScript?_Graphics_Canvas_Svg - Fatal编程技术网

Graphics SVG/Canvas::shape rendering=";crispEdges“;通过JavaScript?

Graphics SVG/Canvas::shape rendering=";crispEdges“;通过JavaScript?,graphics,canvas,svg,Graphics,Canvas,Svg,我想关闭抗锯齿功能,我认为我需要将形状渲染设置为“CrispEdge” 如何使用JavaScript 这是我的代码中需要关闭抗锯齿的部分: context.strokeStyle = gradient; context.lineWidth = 1; context.moveTo(x + size, y + size); context.lineTo(x + dx, y + dy); context.stroke(); 所以线条应该看起来像右边的,而不是左边的 非常感谢您的帮助 在SVG中,您

我想关闭抗锯齿功能,我认为我需要将形状渲染设置为“CrispEdge”

如何使用JavaScript

这是我的代码中需要关闭抗锯齿的部分:

context.strokeStyle = gradient;
context.lineWidth = 1;
context.moveTo(x + size, y + size);
context.lineTo(x + dx, y + dy);
context.stroke();
所以线条应该看起来像右边的,而不是左边的


非常感谢您的帮助

在SVG中,您可以设置“形状渲染”属性,例如:

someElement.style.shapeRendering = "crispEdges";
或作为属性:

someElement.setAttribute("shape-rendering", "crispEdges");

HTML5画布无法打开/关闭抗锯齿,Ian Hickson在中给出了一些原因。

在SVG中,您可以设置“形状渲染”属性,例如:

someElement.style.shapeRendering = "crispEdges";
或作为属性:

someElement.setAttribute("shape-rendering", "crispEdges");

HTML5 canvas无法打开/关闭抗锯齿功能,Ian Hickson在中给出了一些原因。

Firefox中的SVG元素可能存在可能的重复,Chrome的形状渲染有问题Firefox中的SVG元素可能存在,Chrome的形状渲染有问题