HISE Logo Forum
    • Categories
    • Register
    • Login

    How to make dynamic expansion Artwork accessible for Webview?

    Scheduled Pinned Locked Moved Solved General Questions
    24 Posts 5 Posters 534 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.
    • Christoph HartC
      Christoph Hart @Straticah
      last edited by

      @Straticah yeah, I haven't implemented it yet, but it was pretty simple to add:

      const var WebView1 = Content.getComponent("WebView1");
      WebView1.set("x", 0);
      WebView1.set("y", 0);
      WebView1.set("width", 600);
      WebView1.set("height", 600);
      
      WebView1.setHtmlContent("
      <style>
      body { background: #888; }
      </style>
      <p>Hallo</p>
      <img src=\"{EXP::noicenoicenoice}hise.png\"/>
      ");
      

      Compile the latest commit, create an expansion called noicenoicenoice and slap the hise logo in there, then load this script and it should display the image. I haven't tested it in a compiled plugin but since it uses the default HISE image loading mechanism this should work without issues. Let me know if there are any hiccups / problems.

      Christoph HartC StraticahS 2 Replies Last reply Reply Quote 1
      • Christoph HartC
        Christoph Hart @Christoph Hart
        last edited by

        @Christoph-Hart oh and it needs to be a PNG file because the webview can only load those.

        StraticahS 1 Reply Last reply Reply Quote 0
        • StraticahS
          Straticah @Christoph Hart
          last edited by

          @Christoph-Hart works thank you very much this saved on a lot of time and potential bugs.

          165cb42f-f7ec-4c41-a0da-5b8380cba220-image.png

          creating user interfaces: www.vst-design.com
          founder @prototype.audio https://www.prototype.audio/

          1 Reply Last reply Reply Quote 3
          • StraticahS Straticah has marked this topic as solved
          • StraticahS
            Straticah @Christoph Hart
            last edited by

            @Christoph-Hart

            Let me know if there are any hiccups / problems.

            prototype_sampler_04:! WebView Resource for /%7BEXP::Hardware%20Lab%7Dartwork.png not found
            prototype_sampler_04:! WebView Resource for /%7BEXP::Pro%20Essentials%7Dartwork.png not found
            

            Mac works just fine as you have seen.
            Win works fine if expansion name has no spaces - like "Immersive".

            I have some problems on windows encoding url from expansions with a separator.

            creating user interfaces: www.vst-design.com
            founder @prototype.audio https://www.prototype.audio/

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

            32

            Online

            1.9k

            Users

            12.5k

            Topics

            108.8k

            Posts