Forum

    • Register
    • Login
    • Search
    • Categories

    How to bundle Images for use with External Floating Tile tutorial

    C++ Development
    3
    6
    231
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      ohtravioso last edited by

      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?

      Natan 1 Reply Last reply Reply Quote 0
      • Natan
        Natan @ohtravioso last edited by

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

        1 Reply Last reply Reply Quote 0
        • O
          ohtravioso last edited by

          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?

          O 1 Reply Last reply Reply Quote 0
          • O
            ohtravioso @ohtravioso last edited by

            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?

            1 Reply Last reply Reply Quote 0
            • O
              ohtravioso last edited by

              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.

              1 Reply Last reply Reply Quote 1
              • Christoph Hart
                Christoph Hart last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                14
                Online

                1.1k
                Users

                6.8k
                Topics

                62.4k
                Posts