From Graphics to HTML in div

Hi all,

I’m in WEBGL mode which doesn’t support image() (in 0.5.16 anyway) - how can I load a graphics into a an html div?

JS Fiddle here


1 Like

I guess you could do:

document.getElementById("my-image").innerHTML = '<img src="myimage.jpg">'

or just add that into the html itself.

Did you read the question or did I misunderstand your answer? - The image isn’t saved locally

If I am not mistaken you can use a link in src, so that is not a problem

document.getElementById("my-image").innerHTML = '<img src="">'

3D with WebGL
<div id="my-image">
  <img src="">
1 Like

I’m creating my Graphics on the “fly” therefore I don’t have src link

There are many examples here that you can use then.

Needs to be done with P5…

I can’t help you then. Sorry.

You may try out show() and/or parent() methods: :man_shrugging:

  1. show() ->
  2. parent() ->
1 Like

Thanks @GoToLoop that did the trick


1 Like