android glide 模糊,使用Glide实现高斯模糊效果

本文介绍如何在Android中使用Glide库结合glide-transformations库来实现图片的高斯模糊效果。首先引入相关依赖,然后自定义继承BitmapTransformation的BlurTransformation类,最后在实际使用时通过Glide加载图片并应用BlurTransformation。
摘要由CSDN通过智能技术生成

使用Glide实现高斯模糊效果,供大家参考,具体内容如下

先来看效果

c3346e42815a6997c6aeb95f5622d667.png

ac34464b8ddde8e508ae5b5933eea6a5.png

第一步:引入依赖

implementation 'com.github.bumptech.glide:glide:4.7.1'

implementation 'jp.wasabeef:glide-transformations:2.0.1'

第二步:自定义继承自BitmapTransformation的类

import android.content.Context;

import android.graphics.Bitmap;

import android.graphics.Canvas;

import android.graphics.Paint;

import android.os.Build;

import android.renderscript.RSRuntimeException;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;

import com.bumptech.g

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值