BlurUtils.java 文件源码

java
阅读 36 收藏 0 点赞 0 评论 0

项目:letv 作者:
public static void star_blur(Context context, Bitmap bm, ImageView iv) {
    long t1 = System.currentTimeMillis();
    Bitmap overlay = Bitmap.createBitmap((int) (((float) iv.getMeasuredWidth()) / 6.0f), (int) (((float) iv.getMeasuredHeight()) / 6.0f), Config.ARGB_8888);
    Canvas canvas = new Canvas(overlay);
    canvas.translate(((float) (-iv.getLeft())) / 6.0f, ((float) (-iv.getTop())) / 6.0f);
    canvas.scale(1.0f / 6.0f, 1.0f / 6.0f);
    Paint paint = new Paint();
    paint.setFlags(2);
    canvas.drawBitmap(bm, 0.0f, 0.0f, paint);
    ImageView imageView = iv;
    imageView.setImageDrawable(new BitmapDrawable(context.getResources(), FastBlur.doBlur(overlay, (int) 5.0f, true)));
    LogInfo.log("clf", "模糊处理时间 t=" + (System.currentTimeMillis() - t1));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号