简体   繁体   中英

CamanJS initialize on canvas with image (RETINA BUG)

EDITED: It turned out it's a retina bug. Not replicable on other screens.

Referring Camanjs clear canvas when init Caman()? and posted there http://jsfiddle.net/m1erickson/R4kJM/ CamanJS should accept the canvas with data s argument. Ale documentation seemed to confirmed this fact. But somehow the fiddle is not working. The blue thing disappears once CamanJS initialize.

The code again: http://jsfiddle.net/m1erickson/R4kJM/

HTML:

<canvas id="original" width=100 height=100></canvas>

JS:

var canvas = document.getElementById("original");
var ctx = canvas.getContext("2d");

// make a drawing on the original canvas
ctx.fillStyle = "blue";
ctx.fillRect(20, 20, 60, 40);

// modify the original drawing 
Caman("#original", function () {
   this.brightness(75).render();
});

It's the bug in CamanJS. The issue still and work around described here.

https://github.com/meltingice/CamanJS/issues/188

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM