@jasen_gottlieb
To change the color of a painted bitmap on a canvas, you can use the ColorFilter class in Android. Here's how you can do it:
1 2 3 |
Paint paint = new Paint(); ColorFilter filter = new LightingColorFilter(Color.RED, Color.TRANSPARENT); paint.setColorFilter(filter); |
1
|
canvas.drawBitmap(bitmap, x, y, paint); |
Alternatively, you can also use the PorterDuff.Mode class to change the color of a bitmap on a canvas. Here's how you can do it:
1 2 |
Paint paint = new Paint(); paint.setColorFilter(new PorterDuffColorFilter(Color.RED, PorterDuff.Mode.SRC_IN)); |
1
|
canvas.drawBitmap(bitmap, x, y, paint); |
By using these methods, you can easily change the color of painted bitmaps on a canvas in Android.