Create a second raster map and draw the first raster map into it using the color filter. Then use a second raster file to render a large amount.
EDIT: for the request, here is the code that will do this:
public Bitmap makeTintedBitmap(Bitmap src, int color) { Bitmap result = Bitmap.createBitmap(src.getWidth(), src.getHeight(), src.getConfig()); Canvas c = new Canvas(result); Paint paint = new Paint(); paint.setColorFilter(new LightingColorFilter(color,0)); c.drawBitmap(src, 0, 0, paint); return result; }
You will then call this method once to convert the bitmap to a tinted bitmap and save the result in an instance variable. Then you would use the tinted bitmap directly (without a color filter) in your method that accesses the canvas . (It would also be nice to pre-select the Paint object that you will use in the main drawing method and save it also in the instance variable, rather than allocating a new Paint for each draw).
source share