问题描述
我正在尝试使用Pixastic JavaScript库在Windows 8 Metry Style应用程序中使用JavaScript作为语言进行图像处理。我将画布作为输入参数传递并尝试获取图像并再次将其粘贴到画布上,但我一直得到的图像值为FALSE。
代码:
I am trying to use Pixastic JavaScript library for image manipulation in Windows 8 Metry Style app using JavaScript as language. I am passing canvas as input parameter and trying to get image and binging again to canvas but the image value that i am getting all the time is FALSE. CODE:
// First, draw it into the backing canvas
context.drawImage(video, 0, 0, width, height);
// change brightness and contrast
Pixastic.Client.isIE = false;
Pixastic.process(canvas, 'brightness',
{
'brightness': 2,
'contrast': 0.0,
'leaveDOM': true
},
function (img) {
if (img) {
context.putImageData(img, 0, 0);
}
}
);
我试图找到原因并且它说只有在出现内部错误时此类才返回false或者出现其他一些问题。当我调试代码时,它运行良好没有我的书面代码问题。但是当我在Pixastic库中检查时,我发现在一个条件下检查它返回false
I tried to find the reason and its said that this class returns false only if there is an internal error or some other problem occurs. when i debugged the code its runs fine no issue with my written code. But when i check inside Pixastic library i found that on one condition check its returning false
if(imageIsCanvas&&Pixastic.Client.isIE()){if(Pixastic.debug)writeDebug("Tried to process a canvas element but browser is IE.");return false;
我不知道如何在我的Windows 8应用程序中使用Pixastic。任何人都可以建议在Windows 8应用程序中使用pixastic库吗?
I don't know how can i use Pixastic in my Windows 8 app. Can anyone suggest a way to use pixastic library in Windows 8 app?
推荐答案
似乎Pixastic不支持IE。来自他们的
It seems that Pixastic doesn't support IE. From their website:
您可以将isIE解决方法更改为函数(如下所示)或更改库中的实现。
You could change your isIE workaround to either be a function (as below) or change the implementation in the library.
Pixastic.Client.isIE = function(){ return false; };
虽然毫无疑问其他事情可能会被打破。
Though no doubt other things could be broken.
这篇关于当我尝试在javascript中使用Windows 8 Metro Style应用程序时,pixastic javascript库在图像标记中返回false?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!