0

How to blur an image(png) and then load it to image view using setBackgroundResource(R.drawable.*). It must work on API > 10

I have found some solutions, but i don't know how to take image from @drawable and load it to imageview

Thanks in advance...

2 Answers2

1

these ways to set the image to ImageView

imageView.setImageResource(R.drawable.ic_launcher);

or

imageView.setBackground(getResources().getDrawable(R.drawable.ic_launcher));

or

BitmapDrawable drawable = (BitmapDrawable) getResources().getDrawable(R.drawable.ic_launcher);
imageView.setImageBitmap(drawable.getBitmap());
balaji koduri
  • 1,321
  • 9
  • 25
1

This library does what you are looking for: https://github.com/kikoso/android-stackblur

Rampo
  • 249
  • 1
  • 2
  • 12