I have a jpeg “screen” and a number from 0 to 255.
The jpeg is partially transparent.
The number should be used to achieve a grayscale Drawable like it is used in this example to set the background:
setBackgroundColor(Color.rgb(number, number, number));
Now, I want to programaticly merge these to values to get a single Image with the “number-Drawable” as Background and the jpeg overlaying it.
How can i achieve that?
You can use a
LayerDrawablewith a color drawable and a bitmap drawable as the layers. Please take care of supplying the transparency to the bitmap drawable as JPEG image format does not support transparency. Or use a PNG format for the “screen”.