Question

I have an image that is a white square. I would like to convert it to a grey image on a white background. I think alpha could be used here but i am not sure.

Was it helpful?

Solution

Hey you can use setColorFilter() method of image view to set a filter/tint for your imageview. sample-

  imageView.setColorFilter(Color.GRAY);

 imageView.setColorFilter(Color.GRAY,PorterDuff.Mode.Lighten);

the second one gives a tinted effect.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top