Code example for Matrix

Methods: setValues

0
  /** Buffer. */ 
  private static Bitmap bufferBM = Bitmap.createBitmap(1, 1, Config.ARGB_8888);
  /** Buffer. */ 
  private static Canvas bufferCanvas = new Canvas(bufferBM);
  /** Transformation matrix. */ 
  private static final Matrix T = new Matrix();
  /** Initial state. */ 
  private static final float[] T_INIT = new float[] {
    1, 0, 0, 
    0, 1, 0, 
    0, 0, 1 
  }; 
  static { T.setValues(T_INIT); }
 
  /** 
   * @param bg drawable 
   * @param x coordinate 
   * @param y coordinate 
   * @return color of pixel at (x, y) 
   */ 
  public static int getBGColor(final Drawable bg, final int x, final int y) {