如何在颤动中使用CustomPainter模糊图片中的特定位置 [英] How to blur a specific position in the picture using CustomPainter in flutter

查看:173
本文介绍了如何在颤动中使用CustomPainter模糊图片中的特定位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用绘画在图片上添加模糊效果?如果是这样,我该怎么办?

Is it possible to add blur effect to picture using painting? If so, how can I do this?

推荐答案

使用此方法:

Stack(
    children: <Widget>[
      YourImageWidget(),
      new BackdropFilter(
        filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
        child: new Container(
          decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)),
        ),
      ),

    ],
  )

这篇关于如何在颤动中使用CustomPainter模糊图片中的特定位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆