How to bundle Images for use with External Floating Tile tutorial



  • So I'm using the External Floating Tile Tutorial. I'd like to bundle images so they're part of the BinaryData classes generated by the ProJucer. Where do I put these so they get generated, and not blown away on an export of the Plugin?

    If I add them to the Images folder, they don't seem to get picked up. If I put them in the Source/Images folder that contains stock HISE images for dialogs and such, they don't get bundled in either. If I add them manually to the ProJucer file, they'll get added but then that ProJucer file is blown away on export.

    Any suggestions?



  • @ohtravioso
    In Preference, Turn The "Embed Images" On
    And Place The Image Files Into Your Project >>> Images Folder.



  • I don't see them anywhere in the exported Xcode project files when I do that. Not in PresetData.cpp or in BinaryData.cpp. Since the image isn't being used, could it be getting stripped out on export?



  • When I create an Image in the interface editor and add the image file to it, then the image gets embedded in PresetData.cpp on export. However, how do I access the data to load a juce::Image? It looks like all the images get bundled together under a single const char* for PresetData::images. Anyone know how to load a single image in C++ code from that?



  • I ended up using the Projucer from the command line to turn my images into binary.cpp files, and place them in AdditionalSourceCode folder. It works.



  • You can actually use the normal image handling of HISE in C++ projects. Just make sure that the image is loaded somewhere on your scripted interface before you export, then call

    auto myImage = hise::raw::Pool::loadImage("{PROJECT_FOLDER}MyImage.png");
    

    https://docs.hise.audio/cpp_api/raw/classhise_1_1raw_1_1_pool.html

    You get some benefits over the traditional BinaryData approach: the images are shared across plugin instances and are more compressed.


Log in to reply
 

13
Online

752
Users

3.0k
Topics

24.9k
Posts