我想使用 camanjs 在 Phonegap 上操作我的画布,但是当我在这里使用此代码时
function applySunrise(){
Caman("#myCanvas", function () {
this.sunrise();
this.render();
});
}
它会导致这样的错误:
Uncaught TypeError: Object function () {
var i, pixel, _i, _len, _ref;
if (this.context == null) {
this.context = this.canvas.getContext('2d');
}
this.originalWidth = this.preScaledWidth
= this.width = this.canvas.width;
this.originalHeight = this.preScaledHeight
= this.height = this.canvas.height;
this.hiDPIAdjustments();
if (!this.hasId()) {
this.assignId();
}
if (this.image != null) {
this.context.drawImage(this.image, 0, 0,
this.imageWidth(), this.imageHeight(), 0,
0, this.preScaledWidth, this.preScaledHeight);
}
this.imageData = this.context.getImageData(0, 0,
this.canvas.width, this.canvas.height);
this.pixelData = this.imageData.data;
if (Caman.allowRevert) {
this.initializedPixelData = Util.dataArray(this.pixelData.length);
this.originalPixelData = Util.dataArray(this.pixelData.length);
_ref = this.pixelData;
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
pixel = _ref[i];
this.initializedPixelData[i] = pixel;
this.originalPixelData[i] = pixel;
}
}
this.dimensions = {
width: this.canvas.width,
height: this.canvas.height
};
Store.put(this.id, this);
this.callback.call(this, this);
return this.callback = function() {};
} has no method 'bind' at file:///android_asset/www/old/js/caman.full.js:219
我正在使用cordova 2.8.1.js
and ,如果有帮助caman.full.js
,我也会使用jquery-1.8.3.min.js
and 。jquery.mobile-1.2.1.min.js