android 图片缩放抗锯齿

时间:2023-11-10 18:01:26

之前用的时候只设置了antialias属性,其实要设置两个flag才行

     paint.setFlags(Paint.ANTI_ALIAS_FLAG|Paint.FILTER_BITMAP_FLAG);
//或者
  canvas.setDrawFilter(new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG|Paint.FILTER_BITMAP_FLAG));