Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to blur imageview in android

Tags:

android

I have an imageview and i set Image Resources programmatically like this:

int resourceId = getResources().getIdentifier("imagename", "drawable", "mypackage");
imgLock.setImageResource(resourceId);

Is there any easy way to show my ImageView with blurry image?

like image 967
aletede91 Avatar asked Jan 08 '15 01:01

aletede91


People also ask

How can I blur the image in Android?

Tap on the photo you wish to blur. Tap on Mosaic to open the edit tools. Now, tap and swipe on the screen to blur a portion. Tap inside the selected area and move it to the respective position.

How can I blur color in Android?

There are two way to achieve. 1) You can use FrameLayout to which you can set blur background. 2) You can use latest Blur library which i have !

How do you blur out part of a picture?

Step 1: Download the YouCam Perfect app. Step 2: Open the app and click Photo Edit. Step 3: Find the Blur tool in Tools. Step 4: Adjust the blur shape and then select the background you want to blur.


1 Answers

You can use glide transformations https://github.com/wasabeef/glide-transformations you can blur the image with one line of code

Glide.with(this).load(R.drawable.demo)
    .bitmapTransform(new BlurTransformation(context))
    .into((ImageView) findViewById(R.id.image));
like image 79
user3096729 Avatar answered Oct 02 '22 18:10

user3096729