Canvas.toDataUrl("image/png") no funciona correctamente
Frecuentes
Visto 1,535 veces
0
I am drawing an image onto canvas. after that I do canvas.toDataUrl("image/png"); But it doesn't go fine. Here is the link to jsfiddle!
1 Respuestas
1
No se puede utilizar toDataUrl
after loading an image from another domain into the canvas, as it would open up a security hole (information disclosure from other domains).
Ver ¿Por qué esta línea toDataURL es un error de seguridad?.
contestado el 23 de mayo de 17 a las 12:05
No problem. Please accept the answer if it was useful to you. - neonneo
@MJQ You also can't draw the image to canvas before it has loaded/been cached. - Paul s.
Well, no, the image draw actually does work. It's the toDataUrl
that doesn't, exactly as @MJQ said. - neonneo
No, in that case you are using toDataUrl
before the image is drawn. So toDataUrl
works but produces a blank canvas image. - neonneo
No! I first draw image then do toDataUrl and then again draw image from src of toDataUrl!!!!! - MJQ
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas javascript html html5-canvas or haz tu propia pregunta.
What is not working? What is the code expected to do? - jbalsas
Got the answer from nneonneo! Thanks for your concern! - MJQ