Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/449.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
我在使用Pixastic的HTML5画布和Javascript过滤器处理图像时遇到问题,我做错了什么?_Javascript_Html_Image Processing_Html5 Canvas_Pixastic - Fatal编程技术网

我在使用Pixastic的HTML5画布和Javascript过滤器处理图像时遇到问题,我做错了什么?

我在使用Pixastic的HTML5画布和Javascript过滤器处理图像时遇到问题,我做错了什么?,javascript,html,image-processing,html5-canvas,pixastic,Javascript,Html,Image Processing,Html5 Canvas,Pixastic,Javascript“pixastic.custom(5)文件是从pixastic创建的,只使用核心代码和“light”“过滤器。该代码用于在Mozilla浏览器中在画布中重新绘制图像,但不进行过滤。HTML5正在对画布进行编码,在画布上绘制图像,并通过Javascript过滤器将图像重新绘制到画布上,然后在画布上使图像变亮。这些有意义吗 下面是我的代码: <!DOCTYPE HTML> <html> <head> <script type="t

Javascript“pixastic.custom(5)文件是从pixastic创建的,只使用核心代码和“light”“过滤器。该代码用于在Mozilla浏览器中在画布中重新绘制图像,但不进行过滤。HTML5正在对画布进行编码,在画布上绘制图像,并通过Javascript过滤器将图像重新绘制到画布上,然后在画布上使图像变亮。这些有意义吗

下面是我的代码:

<!DOCTYPE HTML>
<html>
<head>
    <script type="text/javascript" charset="utf-8" src="pixastic.custom  (5).js"></script>
    <style>
        body {
            margin: 0px;
            padding: 0px;
        }
        #myCanvas {
            border: 1px solid #9C9898;
        }
    </style>
    <script>
        window.onload = function() {
            var canvas = document.getElementById("myCanvas");
            var context = canvas.getContext("2d");
            var imageObj = new Image();
            imageObj.onload = function() {
                var options ={};
                Pixastic.process(imageObj, "lighten", options)
                    {amount : .5
                };
                options.resultCanvas;
                context.drawImage(imageObj, 80, 60);
            }

            imageObj.src = "IMAG8703.jpg";
        };
    </script>
</head>
<body>
    <canvas id="myCanvas" width="2000" height="4000"></canvas>
</body>
    </html>

身体{
边际:0px;
填充:0px;
}
#我的画布{
边框:1px实心#9C9898;
}
window.onload=函数(){
var canvas=document.getElementById(“myCanvas”);
var context=canvas.getContext(“2d”);
var imageObj=新图像();
imageObj.onload=函数(){
var选项={};
Pixastic.进程(imageObj,“减轻”,选项)
{金额:.5
};
options.resultCanvas;
drawImage(imageObj,80,60);
}
imageObj.src=“IMAG8703.jpg”;
};

谢谢你查看我的代码…我真的不知道为什么它不工作。所有内容都在同一个目录中,并且所有内容都匹配。代码是从PIXASTIC站点与HTML5画布框架组合而成的,一切都应该顺利进行…

问题在脚本标签的第7行。不知道你想做什么,但会出错的

这是合法的

Pixastic.process(imageObj, "lighten", {amount : .5});