I’m currently writing a control panel that will display 36 big vertical metes on screen at once. So i need to make my meter routines as CPU efficient as possible. I’m trying to think of a good technique, i was going to draw the meter in a component then re size it but the problem with that is since Y = 0 is at the top of the image where I can only crop the image from the bottom up by adjusting height its not working out. i was also thinking of using a Image brush then do an alpha fill in a rectangle I’ll re-size with the meter data but I’m afraid that will take to much CPU and will be hard to sync with the repaint calls.
does anyone have a suggestion on how to go about making a very efficient vertical meter in juce??
for ppmulator I used two images, one of the background, and one of the background with the bar overlaid. Then blitted the appropriate bits of those, which avoided any alpha-compositing (which is slow), and just repainted the minimum area that had changed. I think that’s about as good as you’ll get…
Most of the examples I’ve found is with in direct X.
does anyone of an example of this working in juce or does this technique need to be done on a lower level??
Blitting just means copying blocks of image data around - so just use the juce drawing code! The important point is just to avoid drawing any pixels of your component more than once, so avoiding things like filling it with a background colour before drawing, or overlaying graphics with alpha-mapped compositing.