How to load image from binary?

Hi,

I try to load binary, then create blob and url by URL.createObjectURL, and use this url to load image
Here is a test code.
I can see the image show at new window (window.open(url, '_blank')) from created url. But can’t load image successful.

  • No error message in console. It seems that image/data is loaded
  • Can’t not show image well, it might be incorrect image data, imo.

You might ask why I do not load image from url directly?
Because that image data can be xor encryption, thus I have to load binary and do xor decryption, then load this binary result into texture manager through scene.load.image.

The order of the parameters are wrong, it should be:
this.add.image(400,300,‘card’);

1 Like

Thanks, I can’t believe that I made such kind of mistake.