zoukankan      html  css  js  c++  java
  • 高斯模糊处理

    //存放图片的字段是否为空
    if
    (!TextUtils.isEmpty(personInfoBean.avatar)) { //调用Picasso图片缓存库 Picasso.with(getContext()).load(personInfoBean.avatar + ImagSizeMode.imageSizeBeens[3].size).into(civPhoto, new Callback() { @Override
    //图片下载成功civPhoto
    public void onSuccess() { blur(true); } //图下载失败 @Override public void onError() { blur(false); } }); } else { blur(false); }
        /**
         * 高斯模糊处理
         */
        private void blur(boolean hasChanged) {
    //civPhoto没有更新,获取civPhot原来图片
    if (hasChanged) { rightTop.setImageDrawable(civPhoto.getDrawable()); }
    //高斯模糊 rightTop.getViewTreeObserver().addOnGlobalLayoutListener(
    new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { rightTop.getViewTreeObserver().removeOnGlobalLayoutListener(this); Blurry.with(getContext()) .radius(10) .sampling(1) .color(Color.argb(0, 0, 0, 0)) .async() .capture(rightTop) .into(rightTop); } }); }
  • 相关阅读:
    函数重载和函数指针在一起
    Uva
    Uva
    Uva
    Uva
    Uva
    CCPC-Wannafly-day5
    CCPC-Wannafly-day3
    CCPC-Wannafly-day2
    CCPC-Wannafly-Winter 2020.01.12总结
  • 原文地址:https://www.cnblogs.com/rookie-26/p/5713587.html
Copyright © 2011-2022 走看看