0

我似乎可以让恢复功能在 Pixastic 上工作。我在这里想念什么?

 function set_fx( bri, con){
    $("#working-pic").pixastic("brightness",{brightness:bri,contrast:con});
 }

 function fx_reset() {
     Pixastic.revert($("#working-pic"));
 }
4

2 回答 2

1

只需使用:

function fx_reset() {
   Pixastic.revert($("#working-pic")[0]);
}
于 2014-08-05T13:29:22.907 回答
1

Adding [0] made a big difference. Definitely did the trick for me. Give it a try

Pixastic.revert($(this).find('.imageUrl')[0]);

Another thing is i had to create a VAR as pixastic creates a duplicate canvas. This is my whole function:

$(function () {

        $('.col1.w1').mouseenter(function () {


            var origImg = ($(this).find('.imageUrl'));
            if (origImg.is('img')) {
                Pixastic.process(origImg[0], 'blurfast', { amount: 2 });
            }


        });
        $('.col1.w1').mouseout(function () {
            var origImg = ($(this).find('.imageUrl'));
            Pixastic.revert($(this).find('.imageUrl')[0]);


        });
    });
于 2014-02-07T14:57:33.180 回答