Android - 从drawable中模糊图像并将其加载到imageview

时间:2014-01-04 21:54:09

标签: android image imageview blur

如何模糊图像(png),然后使用setBackgroundResource(R.drawable。 * )将其加载到图像视图。它必须适用于API> 10

我找到了一些解决方案,但我不知道如何从@drawable中获取图像 并将其加载到imageview

提前致谢...

2 个答案:

答案 0 :(得分:1)

将图像设置为ImageView

的这些方法
imageView.setImageResource(R.drawable.ic_launcher);

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

BitmapDrawable drawable = (BitmapDrawable) getResources().getDrawable(R.drawable.ic_launcher);
imageView.setImageBitmap(drawable.getBitmap());

答案 1 :(得分:1)

此库可以满足您的需求:https://github.com/kikoso/android-stackblur

相关问题