# Decoding a byteArray image

**URL:** <https://forum.kirupa.com/t/decoding-a-bytearray-image/261517>\
**Category:** flash\
**Created:** [May 28, 2008, 1:53pm UTC](https://forum.kirupa.com/t/decoding-a-bytearray-image/261517 "2008-05-28T13:53:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gag4n](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@gag4n](https://forum.kirupa.com/u/gag4n)\
**Post date:** [May 28, 2008, 1:53pm UTC](https://forum.kirupa.com/t/decoding-a-bytearray-image/261517/1 "2008-05-28T13:53:10Z")

</div>

I don’t know if this is possible (haven’t seen it done anywhere). Is there a way to decode a Base64 string back into a ByteArray and subsequently into a Bitmap so that it can be displayed within Flash?

I have successfully been able to encode the BitmapData into PNG via a PNGEncoder class. This results in a ByteArray which I have encoded using a Base64 class.

Any help much appreciated.

---

<div class="post-metadata">

**Author:** ![Iamthejuggler](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@Iamthejuggler](https://forum.kirupa.com/u/Iamthejuggler)\
**Post date:** [May 28, 2008, 3:10pm UTC](https://forum.kirupa.com/t/decoding-a-bytearray-image/261517/2 "2008-05-28T15:10:53Z")

</div>

[http://dynamicflash.com/2006/09/actionscript-30-base64-encoderdecoder/](http://dynamicflash.com/2006/09/actionscript-30-base64-encoderdecoder/)

That sounds like what you are asking for.

---

<div class="post-metadata">

**Author:** ![gag4n](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@gag4n](https://forum.kirupa.com/u/gag4n)\
**Post date:** [May 28, 2008, 3:22pm UTC](https://forum.kirupa.com/t/decoding-a-bytearray-image/261517/3 "2008-05-28T15:22:49Z")

</div>

Thanks for the link.

I am finding the process of decoding the data into a bitmap/image the most challenging.

I have found the following but do not know how it works.  
[http://blog.gepatto.nl/2005/11/23/code-test/](http://blog.gepatto.nl/2005/11/23/code-test/)
