# Can't get Scene Capture 2d image to display properly in HTML5

**URL:** <https://forums.unrealengine.com/t/cant-get-scene-capture-2d-image-to-display-properly-in-html5/417240>\
**Category:** Platform & Builds\
**Tags:** webgl, scenecapture2d, HTML5, Scene-Capture, unreal-engine, CPP, question\
**Created:** [February 13, 2018, 9:00pm UTC](https://forums.unrealengine.com/t/cant-get-scene-capture-2d-image-to-display-properly-in-html5/417240 "2018-02-13T21:00:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ultrabuffalo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ultrabuffalo](https://forums.unrealengine.com/u/Ultrabuffalo)\
**Post date:** [February 13, 2018, 9:00pm UTC](https://forums.unrealengine.com/t/cant-get-scene-capture-2d-image-to-display-properly-in-html5/417240/1 "2018-02-13T21:00:52Z")

</div>

Hello, we’re creating an Html5 project and are trying to save out an image of the screen in browser. We are using Scene Capture 2d to take a screenshot of the viewport on the web and are convert this capture to a RawPixel array in C++. When we try to use the created image, we end up getting an image like this:

 ![230550-html5imagecapture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/d/f8dc5a1e2c04de54b90f116e0bc79babc7169b05.jpeg)

We are getting this error in the Chrome Developer Tools: WebGL: INVALID\_ENUM: readPixels: invalid format

Does anyone have any idea what could be going wrong? The image works correctly when inside of the editor and when packaged for anything but HTML5.

Thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7e4e2181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7e4e2181](https://forums.unrealengine.com/u/anonymous_user_7e4e2181)\
**Post date:** [February 15, 2018, 4:44pm UTC](https://forums.unrealengine.com/t/cant-get-scene-capture-2d-image-to-display-properly-in-html5/417240/2 "2018-02-15T16:44:37Z")

</div>

just out of curiosity, does this work on firefox?

---

<div class="post-metadata">

**Author:** ![Ultrabuffalo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ultrabuffalo](https://forums.unrealengine.com/u/Ultrabuffalo)\
**Post date:** [February 15, 2018, 6:23pm UTC](https://forums.unrealengine.com/t/cant-get-scene-capture-2d-image-to-display-properly-in-html5/417240/3 "2018-02-15T18:23:40Z")

</div>

Sadly, no. I’m getting the same image out of there.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7e4e2181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7e4e2181](https://forums.unrealengine.com/u/anonymous_user_7e4e2181)\
**Post date:** [February 23, 2018, 8:51pm UTC](https://forums.unrealengine.com/t/cant-get-scene-capture-2d-image-to-display-properly-in-html5/417240/4 "2018-02-23T20:51:41Z")

</div>

ok, i’m trying to run one of our test maps (ContentExamples – with Reflection level) but, there seems to be a bug with the memory system and ICU initialization that’s preventing me from running this…

i will get back to this after a little bit of vacation time (mid march). apologies for the delay.

---

<div class="post-metadata">

**Author:** ![Ultrabuffalo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ultrabuffalo](https://forums.unrealengine.com/u/Ultrabuffalo)\
**Post date:** [February 23, 2018, 11:13pm UTC](https://forums.unrealengine.com/t/cant-get-scene-capture-2d-image-to-display-properly-in-html5/417240/5 "2018-02-23T23:13:22Z")

</div>

Great, I’ll be sure to comment if we can get anywhere in the meantime. Thanks for the help, have a nice vacation!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_98b60827](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_98b60827](https://forums.unrealengine.com/u/anonymous_user_98b60827)\
**Post date:** [March 21, 2018, 6:06pm UTC](https://forums.unrealengine.com/t/cant-get-scene-capture-2d-image-to-display-properly-in-html5/417240/6 "2018-03-21T18:06:03Z")

</div>

Any update here, having exactly the same issue in a HTML5 build ?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7e4e2181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7e4e2181](https://forums.unrealengine.com/u/anonymous_user_7e4e2181)\
**Post date:** [March 21, 2018, 9:08pm UTC](https://forums.unrealengine.com/t/cant-get-scene-capture-2d-image-to-display-properly-in-html5/417240/7 "2018-03-21T21:08:02Z")

</div>

ok, i must admit - i’m a programmer and not a designer… so i followed the tutorial at:

- [Unreal Engine 4 Tutorial - Basic Camera Feed - YouTube](https://www.youtube.com/watch?v=jWRkM-95k2I)

this uses “Scene Capture 2D” – and i just tried this on 4.19 (hot off the press!) and the step by step instructions worked when i packaged for HTML5.

---

<div class="post-metadata">

**Author:** ![scalabro12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@scalabro12](https://forums.unrealengine.com/u/scalabro12)\
**Post date:** [April 15, 2023, 11:44pm UTC](https://forums.unrealengine.com/t/cant-get-scene-capture-2d-image-to-display-properly-in-html5/417240/8 "2023-04-15T23:44:19Z")

</div>

How did you send your Render Target? I would like to send the array od two render targets via TCP, I managed to do that with a C++ class, but maybe it’s possible also via Blueprint or in a more trivial way.
