0

When PreloadJS loads in an SVG via LoadQueue(false), the result will be an <object/> as opposed to an <img/>.

It seems that the EaselJS Bitmap() constructor will only display SVG loaded in as <img/>.

How can I either:

  1. Get Bitmap() to accept the SVG <object/> as loaded in in by PreloadJS.
  2. OR get PreloadJS to load the SVG in as <img/>.
  3. OR convert the SVG <object/> to <img/>
4

1 回答 1

1

“preloadjs”:“1.0.1”

var loader = new createjs.LoadQueue(crossOrigin = '');
loader.on("complete", onComplete);
loader.loadManifest([
    { id: "map", src: "map/monitor.svg", type: createjs.Types.IMAGE },
]);

function onComplete(e) {
    //画背景图
    drawImage(bgLayer, loader.getResult('map'), 0, 0);
}

无法使用 CreateJS 预加载和显示 SVG

于 2018-08-29T03:34:29.603 回答