我有一个imageView,想要应用一个过滤器使它变得模糊,我使用android studio并且sdk的版本min是17,帮我实现这个任务
答案 0 :(得分:0)
我认为您可以使用setAlpha()
方法。
赞imageView.setAlpha(floatValue);
"的floatValue"范围从0到1.
为您的目的尝试低于1的值。
答案 1 :(得分:0)
了解/ Google“卷积滤镜”,这是一种根据周围像素值更改像素值的方法。因此除了模糊之外,您还可以进行图像锐化和线条查找。
如果您的问题是如何模糊,那么您可以使用
imageview = (ImageView) itemView.findViewById(R.id.imageView);
BitmapDrawable drawable = (BitmapDrawable) imageview.getDrawable();
Bitmap bitmap = drawable.getBitmap();
Bitmap blurred = blurRenderScript(bitmap, radiusArr[position]);//second parametre is radius
imageview.setImageBitmap(blurred);
如需更多参考,请参阅此网址 https://github.com/Cutta/Simple-Image-Blur
答案 2 :(得分:0)