'How to get single color image from Bitmap?
I upload a png-image with an alpha channel to the drawable folder. From this picture I get a Bitmap, which has transparency in certain places.
int resID = context.getResources().getIdentifier(bitmapName, "drawable", context.getPackageName());
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), resID);
I need to get a new Bitmap in which all colors are replaced by one color (for example, red), and the alpha channel should remain unchanged. There was a colored Bitmap with transparent areas, but I need a Bitmap with the same transparent areas, but the same color. Tell me how to achieve this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
