Reputation: 340
I have a ImageView where I put a Bitmap (left), sometimes I wanna see bitmap with a semitransparent blue layer (right). I try with a ColorFilter (LightingColorFilter and PorterDuffColorFilter) but I get a dark blue, how can I do this with ColorFilter or anything else?
Thanks.
EDIT (I tried this and other variants)
//ColorFilter filter = new PorterDuffColorFilter(color.wather, PorterDuff.Mode.DST_OVER);
ColorFilter filter = new LightingColorFilter(color.mul, color.wather);
// mul = 0xFFFFFFFF and wather = 0x7000FFFF
BitmapScaler scaler = new BitmapScaler();
imagen.setImageBitmap(scaler.getScaled());
imagen.setColorFilter(filter);
I tried diferents mul, add values and always get this:
Upvotes: 1
Views: 745
Reputation: 340
I've already finds the mul, add values, I had a problem with color.xml because I used ID number instead the color RGB number, big mistake. Transparence (Alpha) are ignore but I can get the effect downing intensity of add value.
int mul = 0xFFFFFF;
int add = 0x005050;
filter = new LightingColorFilter(mul, add);
Thanks Elior for your help.
Upvotes: 1