Saving skin dose maps as an image doesn't work in Internet Explorer or Edge
Issue #375
resolved
This should work, I think, but doesn't. I'm using the toDataURL()
of the canvas (2d) or renderer (3d). It works fine in Chrome and Firefox.
Does anyone have any ideas?
function downloadCanvas(link, canvasId, filename) {
link.href = document.getElementById(canvasId).toDataURL();
link.download = filename;
}
function download3dCanvas(link, filename) {
link.href = renderer.domElement.toDataURL('image/png');
link.download = filename;
}
document.getElementById('save2dSkinMap').addEventListener('click', function() {
downloadCanvas(this, 'skinDoseMap', '2dSkinMap.png');
}, false);
document.getElementById('save3dSkinMap').addEventListener('click', function() {
download3dCanvas(this, '3dSkinMap.png');
}, false);
Comments (4)
-
reporter -
Weird that Edge doesn't behave like the others do - you would expect it from IE. I hope the SO helps to fix it, as I've no ideas without doing the research you'll have already done.
-
reporter - changed status to resolved
Skin dose maps can now be saved in Internet Explorer (tested with v11) and Edge browsers. References issue
#61and fixes issue#375→ <<cset 7960ab954d70>>
-
- changed milestone to Future
-
assigned issue to
- changed component to Interface: Data visualisation
- Log in to comment
This might work: http://stackoverflow.com/questions/21860633/download-canvas-to-image-in-ie-using-javascript