ImageHelper.java 文件源码

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

项目:android-study 作者:
public static Bitmap handleImageHighSaturationEffect(Bitmap bitmap) {
  Bitmap bmp =
      Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
  float[] colorMatrixValue = new float[] {
      1.438f, -0.122f, -0.016f, 0, -0.03f, -0.062f, 1.378f, -0.016f, 0, 0.05f, -0.062f, -0.122f,
      1.483f, 0, -0.02f, 0, 0, 0, 1, 0
  };
  ColorMatrix colorMatrix = new ColorMatrix();
  colorMatrix.set(colorMatrixValue);

  Canvas canvas = new Canvas(bmp);
  Paint paint = new Paint();
  paint.setColorFilter(new ColorMatrixColorFilter(colorMatrix));
  canvas.drawBitmap(bitmap, 0, 0, paint);
  return bmp;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号