Canvas css filter lost when I use Jcrop
hi guys
I am using JCROP to crop images and applying a css filter to it. However when the canvas (image) is cropped, it loses its css,
(ie the User chosen filter is lost)
However if I call the same function via button click it works, but not with jcrop
Here is my code
Ehi
- function CanvasCropCSS() { // THIS IS CSS FILTER FUNCTION
- $("#canvas").removeClass();
- var t = $("#Hidden_Filter").val(); //It gets the value of the applied filter from a hidden field
- alert(t);
- // $("#canvas").AddClass($(('#Hidden_Filter').val()); // This only works when applied to a button event
- };
- function applyCrop() {
- canvas.width = prefsize.w;
- canvas.height = prefsize.h;
- context.drawImage(image, prefsize.x, prefsize.y, prefsize.w, prefsize.h, 0, 0, canvas.width, canvas.height);
- validateImage();
- CanvasCropCSS() // THIS IS CSS FILTER FUNCTION -
-
- }
- // The CanvasCropCSS funtion does not work if I add it to the JCROP, but works if I apply to a button event or anything else