allow snapshots in jpeg format
This commit is contained in:
parent
dd07e5cf9b
commit
48fd8c6e72
|
@ -279,11 +279,13 @@ $(document).ready(function () {
|
|||
});
|
||||
|
||||
$("#snapshot").on("click",function() {
|
||||
match.viewControl("takeSnapshot")
|
||||
match.viewControl("takeSnapshot",{
|
||||
format: "jpeg"
|
||||
})
|
||||
.then((snapshot)=>{
|
||||
var a = document.createElement("a");
|
||||
a.href = snapshot;
|
||||
a.setAttribute("download",gameName+".png");
|
||||
a.setAttribute("download",gameName+".jpg");
|
||||
a.click();
|
||||
})
|
||||
.catch((error)=>{
|
||||
|
|
|
@ -2777,7 +2777,7 @@ if(window.JoclyXdViewCleanup)
|
|||
if(threeCtx) {
|
||||
var canvas = threeCtx.renderer.domElement;
|
||||
threeCtx.renderer.render( threeCtx.scene, threeCtx.camera );
|
||||
resolve(canvas.toDataURL("image/png"));
|
||||
resolve(canvas.toDataURL("image/"+(options.format || "png")));
|
||||
} else
|
||||
reject(new Error("Snapshot only available on 3D views"));
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue