We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I wrote a program for choosing colors for an LED-Strip. It works quite good, but it seems to be using quite alot of CPU. (30% CPU, i5 7600k @4.6ghz)
I know that this usage is due to my program constantly loading pictures:
fade = loadImage("fade.jpg"); red = loadImage("red.jpg"); green = loadImage("green.jpg"); blue = loadImage("blue.jpg"); plus = loadImage("plus.jpg"); minus = loadImage("minus.jpg");
image(fade, 1, 241, boxsize-1, boxsize-1); image(red, 82, 241, boxsize-2, boxsize-1); image(green, 161, 241, boxsize-1, boxsize-1); image(blue, 241, 241, boxsize-1, boxsize-1); image(plus, 401, 241, boxsize-1, boxsize-1); image(minus, 481, 241, boxsize-1, boxsize-1);
Can someone help me to adapt it? How do I load the pictures without consantly having to draw them? It would be enough to draw them once when the program starts.