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

Error: Failed to execute 'toDataURL' on 'HTMLCanvasElement' #70

Open
dpz3579 opened this issue May 26, 2016 · 1 comment
Open

Error: Failed to execute 'toDataURL' on 'HTMLCanvasElement' #70

dpz3579 opened this issue May 26, 2016 · 1 comment

Comments

@dpz3579
Copy link

dpz3579 commented May 26, 2016

i tries to save the Image created in canvas,

but it gives me error as :
Error: Failed to execute 'toDataURL' on 'HTMLCanvasElement'

mycode is as follows :

var canvasMemDOM =$('<canvas>');
var canvasMem=canvasMemDOM.get(0);

$(canvasMemDOM).attr('width', imageWidth+"px");
$(canvasMemDOM).attr('height', imageHeight+"px");

var ctxMem=canvasMem.getContext("2d");
ctxMem.drawImage(img, 0, 0, imageWidth, imageHeight);
ctxMem.drawImage(canvas, 0, 0);

canvasImageUrl = canvasMem.toDataURL();

i get error at last line..

canvasImageUrl = canvasMem.toDataURL();
@gsadhas
Copy link

gsadhas commented Apr 14, 2017

set crossOrigin = "Anonymous" for the img

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