# Help adding images/binary data

**URL:** <https://forum.juce.com/t/help-adding-images-binary-data/24012>\
**Category:** General JUCE discussion\
**Created:** [September 1, 2017, 7:02pm UTC](https://forum.juce.com/t/help-adding-images-binary-data/24012 "2017-09-01T19:02:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveH](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daveh/32/4924_2.png) [@DaveH](https://forum.juce.com/u/DaveH)\
**Post date:** [September 1, 2017, 7:02pm UTC](https://forum.juce.com/t/help-adding-images-binary-data/24012/1 "2017-09-01T19:02:31Z")

</div>

Hi, I want to add resources to Juce.  
I added a new group called Resources. Then add ‘existing file’ and select my .png file. It then adds it with ‘Binary Resource’ ticked.  
When I save and load it into my IDE (VS) it appears as a png file rather than a text file. Am I doing anything wrong? I thought we’re supposed to make separate files out of our resources.

---

<div class="post-metadata">

**Author:** ![holy-city](https://avatars.discourse-cdn.com/v4/letter/h/8491ac/32.png) [@holy-city](https://forum.juce.com/u/holy-city)\
**Post date:** [September 1, 2017, 7:08pm UTC](https://forum.juce.com/t/help-adding-images-binary-data/24012/2 "2017-09-01T19:08:22Z")

</div>

Not sure what your issue is, if you add a .png file wouldn’t you expect it to be a .png file?

If you want the file as a char array, the Projucer adds a pair of files named BinaryData.h and BinaryData.cpp under the /JuceLibraryCode/ directory. The binary data can be accessed as a char array like this:

```
#include "../JuceLibraryCode/JuceHeader.h"

const char* data = BinaryData::filename_extension;
const int dataSize = BinaryData::filename_extension_size;
```

---

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [September 1, 2017, 7:21pm UTC](https://forum.juce.com/t/help-adding-images-binary-data/24012/3 "2017-09-01T19:21:14Z")

</div>

Use BinaryBuilder in the extras folder to generate the BinaryData files.

Rail

---

<div class="post-metadata">

**Author:** ![DaveH](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daveh/32/4924_2.png) [@DaveH](https://forum.juce.com/u/DaveH)\
**Post date:** [September 1, 2017, 7:24pm UTC](https://forum.juce.com/t/help-adding-images-binary-data/24012/4 "2017-09-01T19:24:08Z")

</div>

That’s where I was getting confused, because now you can just add them into your Projucer project and they will be saved for you. Thanks Holy\_City for showing me the way. So is this the best way to store png files then? I have quite a lot of images to use.
