Open 5ajish opened 10 years ago
How are you loading the existing image?
Hi brinley,
This is my code to load image on canvas.
var canvas = document.querySelector('#signature canvas') context = canvas.getContext('2d');
var erase_image = new Image(); erase_image.src = 'yee.jpg'; erase_image.onload = function() { context.drawImage(erase_image, 0, 0, canvas.width,canvas.height); } erase_image.setAttribute('crossOrigin','anonymous');
I need to make it work on windows app so it works well on IE 10, but google chrome blocks it as Cross-Origin Resource Sharing policy.
If your image is fixed, you can convert the image to a data url and use jSignature's setData to import it into the signature.
Yes, I did it and I got base 64 but when I resize or press reset button the background image disappears. I think canvas is being reloaded. Can we prevent this?
I reloaded image on canvas on browser resize but signature gets behind the image since I reloaded the image again. Any ideas?
Hi guys!!
I have successfully loaded an image on existing canvas. I could draw signature on it. I can also generate base64 string of final image. (Image with default loaded jpeg/png image on canvas + signature drawn over it.) But when I resize my browser or click reset, the loaded image get disappears. Can we prevent this?
It would be grateful, if anyone could help me out.