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/>
Philip Bulley
  • 9,014
  • 3
  • 33
  • 46
  • This is maybe not the answer you want to hear, but I'd recommend you to convert your SVG to createJS code using this method: http://tomkrcha.com/?p=3640 – olsn May 07 '13 at 07:58
  • Hey olsn, I'm thankful for all suggestions! Looks interesting. Perhaps I'll be able to convince the designers to output using the Drawscript panel :) – Philip Bulley May 07 '13 at 09:45
  • You can also bring the SVG into Adobe Animate, which can publish to HTML (native EaselJS paths) – Lanny Aug 29 '18 at 13:44

1 Answers1

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);
}

Unable to preload and display SVG with CreateJS

Lizz
  • 11
  • 2