HISE Logo Forum
    • Categories
    • Register
    • Login

    PNG Transparency.

    Scheduled Pinned Locked Moved General Questions
    4 Posts 2 Posters 196 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.
    • lalalandsynthL
      lalalandsynth
      last edited by

      Is it possible to dynamically control a PNG transparency ?

      https://lalalandaudio.com/

      https://lalalandsynth.com/

      https://www.facebook.com/lalalandsynth

      https://www.facebook.com/lalalandsynth

      ? 1 Reply Last reply Reply Quote 0
      • ?
        A Former User @lalalandsynth
        last edited by

        @lalalandsynth I Just started a project that needs this :)

        Using a panel:

        const var Knob1 = Content.getComponent("Knob1");
        const var Panel1 = Content.getComponent("Panel1");
        
        Panel1.loadImage("{PROJECT_FOLDER}image.png", "image");
        
        Panel1.setPaintRoutine(function(g)
        {
        	g.setOpacity(Knob1.getValue());	
        	g.drawImage("image", [0, 0, this.getWidth(), this.getHeight()], 0, 0);
        });
        
        inline function onKnob1Control(component, value)
        {
        	Panel1.repaint();
        };
        
        Content.getComponent("Knob1").setControlCallback(onKnob1Control);
        
        lalalandsynthL 1 Reply Last reply Reply Quote 2
        • lalalandsynthL
          lalalandsynth @A Former User
          last edited by

          @iamlamprey Great , I wonder if you could make a knob/indicator with a film strip an then control the opacity of that ?

          https://lalalandaudio.com/

          https://lalalandsynth.com/

          https://www.facebook.com/lalalandsynth

          https://www.facebook.com/lalalandsynth

          ? 1 Reply Last reply Reply Quote 0
          • ?
            A Former User @lalalandsynth
            last edited by

            @lalalandsynth You can put a filmstrip inside the panel and adjust the Y offset using the slider, so yes it can do both functions:

            Link Preview Image
            HISE | Scripting | Script Panel

            The reference guide for the ScriptPanel

            favicon

            (docs.hise.audio)

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

            31

            Online

            1.8k

            Users

            12.0k

            Topics

            104.1k

            Posts