Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to reset #1

Open
mnsaqib opened this issue Sep 5, 2016 · 7 comments
Open

how to reset #1

mnsaqib opened this issue Sep 5, 2016 · 7 comments

Comments

@mnsaqib
Copy link

mnsaqib commented Sep 5, 2016

i would like to appreciate your work.

simply awesome.............

here is my code

<script> ``` var value = 0 $(document).ready(function () { $("#sharp").click(function () { $("#largeImage").philter('sharpen'); }) $('#Reset').click( function () { value = 0 $('#largeImage').philter({ animateTo: value }, 'slow'); }) }); ``` but on resert button click .....it is not going back to its original image. please help me Thanks
@Laboralphy
Copy link
Owner

Laboralphy commented Sep 6, 2016

Well all I can say is that : " { animateTo: value }, 'slow' " is not a set of parameters accepted by the philter plugin.

What is the goal of your "#Reset" button ?
If its goal to reset the image back to it's original state, then you should use
$('#largeImage').philter('restore');

...But don't forget to use $('#largeImage').philter('save'); prior to any call to philter.

I give you a complete example :

<script>
  var value = 0;
  $(window).on( "load", function () {

    $("#largeImage").philter('save'); // the original state of the image is saved

    // attaching "click" event handler on #sharp button
    $("#sharp").on( "click", function () {
      $("#largeImage").philter('sharpen');
    });

    // attaching "click" event handler on #Reset button
    $('#Reset').on( "click", function () {
      $('#largeImage').philter("restore"); // restoring image back to its original state
    });
  });

@mnsaqib
Copy link
Author

mnsaqib commented Sep 6, 2016

$('#largeImage').philter('save');
what is the use of it?

will this save the changes i made to the file?
thanks

one more thing, can add one more filter to the list, Pseudocolor, you can see it in grafis.js

your help will be highly appreciated

@Laboralphy
Copy link
Owner

$('#largeImage').philter('save');

is use to save to current image content into an internal buffer.

when $('#largeImage').philter('restore'); is called, the internal buffer is copied back to the visible image.

Well, you cannot add custom filters at the moment, but I may add this feature soon.

thank you.

@mnsaqib
Copy link
Author

mnsaqib commented Sep 12, 2016

sir,

the code is not working at all
please recheck

if add a new button "save"
and first click on it
then its working

//var value = 0;
$(window).on("load", function () {

$("#save").on( "click", function () {
$("#largeImage").philter('save'); // the original state of the image is saved
});

// attaching "click" event handler on #sharp button
$("#sharp").on( "click", function () {
  $("#largeImage").philter('sharpen');
});

// attaching "click" event handler on #Reset button
$('#Reset2').on( "click", function () {
  $('#largeImage').philter("restore"); // restoring image back to its original state
});

});
</script>`

@mnsaqib
Copy link
Author

mnsaqib commented Sep 19, 2016

any update on my request?

@Laboralphy
Copy link
Owner

I need to see all your code including html.
Do you have a testing URL ?

@Laboralphy
Copy link
Owner

Well not all your code but at least the context html with the referenced elements ("save" "largeimage" etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants