在GWT中借助JSNI使用MozimagesoothingEnabled
Gecko 1.9.2将mozImageSmoothingEnabled属性引入canvas元素;如果此布尔值为false,则缩放时图像将不会平滑。默认情况下,此属性为true在GWT中借助JSNI使用MozimagesoothingEnabled,gwt,html5-canvas,jsni,Gwt,Html5 Canvas,Jsni,Gecko 1.9.2将mozImageSmoothingEnabled属性引入canvas元素;如果此布尔值为false,则缩放时图像将不会平滑。默认情况下,此属性为true ctx.mozImageSmoothingEnabled = false 我想在GWT中使用此属性。 我如何实施 public static void setMozImageSmooting(Canvas canvas, boolean value) { ... } 通过使用JSNI?我还没有尝试过,
ctx.mozImageSmoothingEnabled = false
我想在GWT中使用此属性。
我如何实施
public static void setMozImageSmooting(Canvas canvas, boolean value)
{
...
}
通过使用JSNI?我还没有尝试过,但我认为,您应该首先获得Java中的上下文:
Context ctx = canvas.getContext2d();
setMozImageSmooting(ctx, false);
然后实施
public static native void setMozImageSmooting(Context ctx, boolean value) /*-{
ctx.mozImageSmoothingEnabled = value;
}-*/;
(如果答案有错误,请随意更正,因为我现在无法测试。)