create Up Triangle Path - Android android.graphics

Android examples for android.graphics:Path

Description

create Up Triangle Path

Demo Code

import android.graphics.Path;

public class Main {

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

    path.moveTo(aX, aY + aHeight);//w  w w . j a  v  a 2  s.co  m
    path.lineTo(aX + (aWidth >> 1), aY);
    path.lineTo(aX + aWidth, aY + aHeight);
    path.close();

    return path;
  }

}

Related Tutorials