Overview
Ipad,iphone the Blur effect on the first page background is not very nice, then how to do it in Android. I have achieved this effect in a way.
Open Source Library Name: Anroid-image-blur
An auxiliary class library for blurring images under Android
GitHub Address
Https://github.com/vir56k/anroid-image-blur
Noun Explanation:
Bokeh, blurring, or frosted glass effects. That is, a picture is blurred, become virtual, similar to the virtual when the picture is seen. In an iOS system, the background behind the boot of the main system is the effect of a blur. Give people a sense of immersion, background and content are related.
Introduced
Create a new image by making a picture virtual.
Original image: After Blur:
Methods for referencing a class library:
- Download Androidimageblur source code library,
- Reference the class library in your project
Code
//缩放并显示Bitmap newImg = BlurUtil.doBlur(img1, 20, 10);
Enter a bitmap bitmap by Blurutil's Doblur method, which returns a bitmap after the blur.
方法名: BlurUtil.doBlur(...)参数: 第一个参数 img1, 是原始的位图图像, 第二个参数 20 , 是缩放的大小,这个数字约大,虚化程度越高 第三个参数 10, 虚化质量,这个数字约大,虚化程度越高返回值: 返回一个 虚化(模糊)后的位图
Android Development-Blur a picture (frosted glass effect, blurry)