Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I was unable to find a solution for this. Here are a couple of methods I tried, and all of them failed:</p> <ul> <li><p>Simply changed the background of a DIV using <code>div.style.backgroundImage = "url("+base64+")"</code></p></li> <li><p>Changed the <code>.src</code> of an image using <code>img.src = base64</code></p></li> <li><p>Removed the old and added the new image using <code>removeChild( document.getElementById("img") ); document.body.appendChild( newImg )</code></p></li> <li><p>The same as above but with a random height on the new image</p></li> <li><p>Removing and adding the image as a HTML5 canvas object. Also doesn't work, since a new <code>Image();</code> has to be created, see *</p></li> <li><p>On launch, created a new <code>Image()</code> object, let's call it container. Displayed the image as <code>&lt;canvas&gt;</code>, every time the image changed, I would change container's <code>.src</code> and redraw the canvas using <code>ctx.drawImage( container, 0,0 )</code>.</p></li> <li><p>The sames as the previous, but without actually redrawing the canvas. Simply changing the <code>Image()</code> object's <code>src</code> uses up memory. </p></li> </ul> <p>A strange thing I noticed: The bug occurs even if the image isn't displayed! For example, when doing this:</p> <pre><code>var newImg = new Image( 1024, 750 ); newImg.src = newString; // A long base64 string </code></pre> <p>Every 5 seconds, and nothing else, no loading or displaying the image, of course wrapped up in an object, also crashes the memory after some time!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload