I am new in three js. I used WebGLRenderer. MY export image resolution based on canvas renderer size. My canvas size 1159*262. My export image works well but I need attempt resize my export image resolution. How to do this? please, someone, give the hints. Here attached sample one 'https://jsfiddle.net/2pha/art388yv/' How would I do resize resolution png image?
var renderer3D ,imgWidth ,imgHeight ;
renderer3D = new THREE.WebGLRenderer({
antialias: true,preserveDrawingBuffer: true
});
this.ExportImage = function(){
imgWidth = 640; //resolution width
imgHeight = 480; //resolution height
fileName = 'construction'+".png";
var a = window.document.createElement("a");
a.href = renderer3D.domElement.toDataURL("image/png", 1.0);
/*a.style.width = imgWidth + 'px';
a.style.height= imgHeight + 'px';*/ //It's not working
a.download = fileName;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
console.log(a);
};