Android 图片高期模糊处理
来源:互联网 发布:软件测试的主要内容 编辑:程序博客网 时间:2024/05/01 18:55
调这一个方法搞定:::
/** * 图片模糊 * * @param bitmap * @return */@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)@RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)public Bitmap blurBitmap(Bitmap bitmap) { //Let's create an empty bitmap with the same size of the bitmap we want to blur Bitmap outBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); //Instantiate a new Renderscript RenderScript rs = RenderScript.create(getActivity()); //Create an Intrinsic Blur Script using the Renderscript ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); //Create the Allocations (in/out) with the Renderscript and the in/out bitmaps Allocation allIn = Allocation.createFromBitmap(rs, bitmap); Allocation allOut = Allocation.createFromBitmap(rs, outBitmap); //Set the radius of the blur blurScript.setRadius(25.f); //Perform the Renderscript blurScript.setInput(allIn); blurScript.forEach(allOut); //Copy the final bitmap created by the out Allocation to the outBitmap allOut.copyTo(outBitmap); //recycle the original bitmap bitmap.recycle(); //After finishing everything, we destroy the Renderscript. rs.destroy(); return outBitmap;}
0 0
- Android 图片高期模糊处理
- Android 图片高斯模糊处理
- android 图片高斯模糊处理方法
- Android 图片高斯模糊处理
- Android 图片高斯模糊处理
- android图片模糊处理 利用高斯算法
- android图片模糊处理
- Android图片模糊处理
- android 图片高斯模糊
- android 图片高斯模糊
- Android图片高斯模糊
- Android图片处理之高斯模糊示例——仿微信朋友圈照片模糊效果
- Glide框架高斯模糊图片处理
- android 图片模糊化处理
- 图片处理--处理成灰色图片,高斯模糊
- android图片高斯模糊的方法
- Android实现图片高斯模糊
- Android 图片实现高斯模糊
- 运行环信demo
- 第一次博客。。POJ-2499
- android打开相机选图及相册选图操作
- JVM 初探:内存分配、GC 原理与垃圾收集器
- spring MVC HelloWord
- Android 图片高期模糊处理
- JAVAWEB开发之JSTL标签库的使用、 自定义EL函数、自定义标签(带属性的、带标签体的)
- 脱壳-Armadillo1.x
- 值得推荐的C/C++框架和库
- Linux下 nexus搭建maven私有库 自动打包
- 5.列偏移
- 操作系统与网络实现 之二十三(乙)
- kaggle简单框架总结
- discuz使用