Hello, I'm drawing to a single canvas, via embind not using SDL. I discovered the preload image option which I'm trying 2 work out how to use so that I can make sure I can get the dimensions of all the images I am loading at the time of construction of my c++ class, since UI dimensions are derived from those images.
I am preloading images with --preload-file ./img@/ producing a .data file alongside my html maps 2 root, all good I can check for the existence of the file with fopen, but I need to draw the image into a canvas. I can see emscripten_get_preloaded_image_data, but that will give me a char* I've been trying to set the .src attribute of an img using the path of one these preloaded files, e.g. val img = val::global("Image").new_(); img.set("src", std::string("knob.png")); but I get a 404 image not found is there any way to preload images in this way and load them into an img for drawing in canvas or am I taking completely the wrong approach? Should I preload images into imgs. in a pre-js if I want to take this approach? thanks very much oli -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.