I want to blur a portion of bitmap and set into image view. But I am not getting any reference of the same.
Asked
Active
Viewed 489 times
-5
-
1'How to do' is not a good question. Show the efforts you tried. – HarshitMadhav Jan 09 '18 at 19:49
-
Do you want to blur an image on touch? – theboringdeveloper Jan 09 '18 at 19:53
-
Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Jan 09 '18 at 20:08
1 Answers
-1
Took me 40 seconds to find the solution in stackoverflow, Please use search :)
Use the blur from here: https://stackoverflow.com/a/10028267/5618671
(Make sure to +1 Yahel, the user that posted the blur solution)
Get your Bitmap (can get it from your existing imageView), Call the fast blur when imageView has been clicked, and set the imageView with the new blurred Bitmap :
example
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//GET BITMAP FROM IMAGEVIEW
BitmapDrawable drawable = (BitmapDrawable) imageView.getDrawable();
Bitmap bitmapFromImageView = drawable.getBitmap();
Bitmap blurredBitmap = fastblur(bitmapFromImageView, BITMAP_SCALE, BLUR_RADIUS)
imageView.setImageBitmap(blurredBitmap);
}
});
P.S Make sure imageview is declared final:
final ImageView imageView;

Dor Rud
- 114
- 6
-
This is doing whole image blur. I want blur some part of image. with ontouch listners – Gautam Sharma Jan 10 '18 at 05:09
-
Do you want blur where user clicked? Please be more specific. This is how to get the location on screen of the user's click: https://stackoverflow.com/a/3476840/5618671 This is for partial blur: https://stackoverflow.com/a/31263734/5618671 Combine those and vouila! – Dor Rud Jan 10 '18 at 08:50
-
I Want a blur effect like Point Blur application. Please refer this application https://play.google.com/store/apps/details?id=jp.co.pointblur.android.app.quick&hl=en – Gautam Sharma Jan 10 '18 at 17:38