I need a little help on what I want to achieve. I use BitmapShaderin my application for painting on canvas. I am setting a custom png file as a shader for my paint variable, and I want to change the color of the shader.
Here is an example of the code I'm using:
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.particle_point);
BitmapShader shader = new BitmapShader(bitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
mPaint.setShader(shader);
ColorFilter filter = new LightingColorFilter(0xFFFFFFFF , 0x000000FF );
mPaint.setColorFilter(filter);
I find that I can change its color using:
ColorFilter filter = new LightingColorFilter(0xFFFFFFFF , 0x000000FF );
but I need to change the color using a special pick-up colors which returns a color code similar to this: -234423123.
So, is there a way I can use this color code and set it as the color for my paint variable.
Thanks in advance!
source
share