imageUtils.js 460 B

12345
  1. /*
  2. All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. See https://js.arcgis.com/4.25/esri/copyright.txt for details.
  4. */
  5. function t(t){const e=t.getFrame(0);if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement)return e;const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const a=n.getContext("2d");return e instanceof ImageData?a.putImageData(e,0,0):a.drawImage(e,0,0),n}export{t as getFirstFrame};