10

I'm trying to set blur background image. Android studio projects are available. But I'm using eclipse. So any one help me to how to set blur image programmatically?

Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
Ajith
  • 169
  • 1
  • 2
  • 12

2 Answers2

15

Use this to set your opacity

android:alpha="0.5"

OR

 yourView.getBackground().setAlpha(100);
Ravindra Kushwaha
  • 7,846
  • 14
  • 53
  • 103
Syed Raza Mehdi
  • 4,067
  • 1
  • 31
  • 47
2

To set transparency level of the view to make it dim

View class have setAlpha(float alpha) method which is Added in API level 11.

So from API level 11 and after you can use that method in xml and class too.

Using xml android:alpha set float value between 0 to 1

For before and after api level 11(for all) third party library is available for alpha and other things also.

NineOldAndroid

ViewHelper.setAlpha(View yourview,float alpha)

What else you can do to make image blure effect is, convert image to bitmap with blur/dim effect. check this

Community
  • 1
  • 1
user1140237
  • 5,015
  • 1
  • 28
  • 56