Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/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
在GWT中借助JSNI使用MozimagesoothingEnabled_Gwt_Html5 Canvas_Jsni - Fatal编程技术网

在GWT中借助JSNI使用MozimagesoothingEnabled

在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?我还没有尝试过,

Gecko 1.9.2将mozImageSmoothingEnabled属性引入canvas元素;如果此布尔值为false,则缩放时图像将不会平滑。默认情况下,此属性为true

 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;
 }-*/;
(如果答案有错误,请随意更正,因为我现在无法测试。)