Some modes on don't work on image components
-
I'm in a bit of a tough spot at the moment. I'm currently using panels and paint routines to overlay some textures over the interface:
const var Texture = Content.getComponent("Texture"); Texture.loadImage("{PROJECT_FOLDER}texture.png", "TextureImage"); Texture.setPaintRoutine(function(g) { g.beginBlendLayer("Overlay", 1); g.drawImage("TextureImage", [0, 0, this.getWidth(), this.getHeight()], 0, 0); g.endLayer(); });
The image is Retina-ready at twice the resolution of the panel.
The problem with that is that depending on screen resolution, the size of the drawn image changes and it doesn't cover the entire panel. It happens both on Windows and Mac and on some screen sizes, it works fine, while at others it doesn't cover the whole panel.
Now, if I were to discard the panel and replace it with an image component with the same picture, set to 0.5 scale, it would work perfect across all devices BUT the problem is, most blending modes don't work there, so if I set the blending of the image to Overlay, it's not drawn at all. Blending modes like Screen work fine, but not Overlay. Multiply doesn't work either.
I'd assume it's faster to fix the blending modes on images than scaling based on the screen size so I'm happy to go with the quickest solution.
@Christoph-Hart could you please fix this?
-
I took some time to investigate this further and it seems like the issue with scaling painted images is caused by the app OS app scaling. Here's the Windows bit, and I'm sure there's something similar on macOS too:
It's perfectly reproducable in HISE, you don't even need to compile the plugin to see the issue.
Changing the drawImage dimensions to fixed pixel values as opposed to
this.getWidth() doesn't solve the issue, unfortunately.I would really appreciate a fix to either the scaling issue, or the blending mode problem as described in the post above. Either one would work for me but it's very important for me to fix the project I'm working on.
Thank you!
-
One more update: blending modes on image components don’t work consistently across all DAWs. In Ableton, the image is diplayed fine but in Reaper it’s not visible at all.
Maybe fixing the scaling is easier after all? @Christoph-Hart it would be great to hear what you think
-
@tomekslesicki what I did once was to write the dimensions like that :
Engine.getOs() == "WIN"? g.drawSomething([area1]) : g.drawSomething([area2]) ;
It works for simple things. But IIRC the blendLayers don't scale with the zoom factor if you're using resizable GUIs
-
I've been having an issue with HISE and Reaper forever. Using Zoom settings in Windows doesn't seem to apply to HISE scaling
-
@Christoph-Hart I’m giving this a friendly bump :-)
-
@Christoph-Hart any hope for fixing it?
-
I've pushed a fix that I think will fix all scaling issues for script panels, but there are so many edge cases and branches in that code that I wouldn't be too surprised if I broke something on another end.
We'll see in a few days :)
Oh and the ScriptImage blending mode is completely broken, I don't know why it should have worked at any time, but the blend function requires a source image to blend on which the logic doesn't supply so there's less than little hope for that solution :)