- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我真的希望有人能够提供帮助...我已经两次、三次和四次检查 Pixastic 库是否正在加载。
这是我的 HTML 代码:
在 <head>
标签:
<script src="pathto.../pixastic.js"></script>
<script src="pathto.../pixastic.effects.js"></script>
<script src="pathto.../pixastic.worker.js"></script>
在 <body>
标签:
<div id="pattern-div" class="">
<div id="preview-background-print"><img id="preview-image" src="/image.png"/></div>
</div>
这是 jQuery。我省略了计算 RGB 偏移的公式,因为它们似乎不相关。但请告诉我他们是否是。 :)
$('#preview-image').pixastic('coloradjust',{
red : pixadjustR,
green : pixadjustG,
blue : pixadjustB
});
这是我收到的错误:
TypeError: $('#preview-image').pixastic is not a function. (In '$('#preview-image').pixastic('coloradjust',{
red : pixadjustR,
green : pixadjustG,
blue : pixadjustB
})', '$('#preview-image').pixastic' is undefined)`
(我也尝试过 Pixastic.process(document.getElementById("preview-image"), "coloradjust"...
并得到 Pixastic.process is not a function
等。
最佳答案
您是否包含 pixastic jquery plugin ?
如果您想在没有 jquery 插件的情况下执行此操作,这与他们在 demo 中的操作方式类似。 :
function pixastic(img, method, options){
// Copy image to canvas
var canvas = document.createElement('canvas');
canvas.width = img.width;
canvas.height = img.height;
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0);
// Create Pixastic object and execute filter.
// The second parameter is the path to the folder containing the worker script
var P = new Pixastic(ctx);
P[method](options).done(function(){
// Copy the data back to the image as dataURI
img.src = canvas.toDataURL();
});
}
pixastic($('img')[0], "coloradjust", {
red : pixadjustR,
green : pixadjustG,
blue : pixadjustB
})
关于javascript - Pixastic ColorAdjust 类型错误未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42398708/
情况 我有一个带有圆形的图像,该图像填充了从白色到黑色/透明度的径向渐变。它用作粒子,需要在其生命周期内着色。 问题 我正在使用 ColorAdjust 将不同的颜色应用于图像。问题是颜色不是我想要的
我真的希望有人能够提供帮助...我已经两次、三次和四次检查 Pixastic 库是否正在加载。 这是我的 HTML 代码: 在 标签: 在 标签: 这是 jQuery。我省略了计算 RGB
应用颜色调整效果并重新绘制 Canvas 后, Canvas 没有被清除,以便我可以用其他图像更新 Canvas ,图像重叠。 我有一个包含滚动 Pane 的边框 Pane 来调整大图像滚动 Pane
我只是制作了一个类,让我可以使用 ColorAjust 类修改图像,例如饱和度、亮度、对比度和色调。 但我不知道如何在进行这些修改后保存该图像。 代码如下: final Stage imageProc
我正在尝试将彩色图像转换为可用的单色图像,但没有“锯齿状”边缘。 来自类似的问题asking to convert an image from color to black and white ,其中
我是一名优秀的程序员,十分优秀!