create Down Triangle Path - Android android.graphics

Android examples for android.graphics:Path

Description

create Down Triangle Path

Demo Code

import android.graphics.Path;

public class Main {

  public static Path createDownTrianglePath(int aX, int aY, int aWidth, int aHeight) {
    Path path = new Path();

    path.moveTo(aX, aY);/*  ww  w. jav a2 s .c  o m*/
    path.lineTo(aX + aWidth, aY);
    path.lineTo(aX + (aWidth >> 1), aY + aHeight);
    path.close();

    return path;
  }

}

Related Tutorials