I have some png files that I apply color to. Color changes according to user choice. I change the color according to 3 RGB values set using a different method. PNG files are random form with full transparency outside the form. I do not want to change the transparency, only the value of RGB. I am currently setting the RGB values per pixel (see code below).
I realized that this is incredibly slow and perhaps not efficient enough in the application. Is there a better way to do this?
This is what I am doing right now. You can see that the pixel array is huge for an image that occupies a decent part of the screen:
public void foo(Component component, ComponentColor compColor, int userColor) { int h = component.getImages().getHeight(); int w = component.getImages().getWidth(); mBitmap = component.getImages().createScaledBitmap(component.getImages(), w, h, true); int[] pixels = new int[h * w];
user432209
source share