PNG Transparency.
-
Is it possible to dynamically control a PNG transparency ?
-
@lalalandsynth I Just started a project that needs this :)
Using a panel:
https://i.gyazo.com/5c2ccb576e1ce3bb7e4806cb8307f4e9.mp4
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);
-
@iamlamprey Great , I wonder if you could make a knob/indicator with a film strip an then control the opacity of that ?
-
@lalalandsynth You can put a filmstrip inside the panel and adjust the Y offset using the slider, so yes it can do both functions:
https://docs.hise.audio/scripting/scripting-in-hise/scriptpanel.html#the-paint-routine