HISE Logo Forum
    • Categories
    • Register
    • Login

    How to bundle Images for use with External Floating Tile tutorial

    Scheduled Pinned Locked Moved C++ Development
    6 Posts 3 Posters 569 Views
    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?

      NatanN 1 Reply Last reply Reply Quote 0
      • NatanN
        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 HartC
                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");
                

                Link Preview Image
                HISE | Docs

                favicon

                (docs.hise.audio)

                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
                • mmprodM mmprod referenced this topic on
                • First post
                  Last post

                14

                Online

                1.7k

                Users

                11.8k

                Topics

                102.8k

                Posts