Created
October 16, 2014 08:00
-
-
Save ZirconCode/59cae1e2615279eafb29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void drawTriangle(Point p1, Point p2, Point p3, int clr, Canvas c) | |
{ | |
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); | |
paint.setStrokeWidth(1); | |
paint.setColor(clr); | |
paint.setStyle(Paint.Style.FILL_AND_STROKE); | |
paint.setAntiAlias(true); | |
Path path = new Path(); | |
path.setFillType(Path.FillType.EVEN_ODD); | |
path.moveTo(p1.x,p1.y); | |
path.lineTo(p2.x,p2.y); | |
path.lineTo(p3.x,p3.y); | |
path.close(); | |
c.drawPath(path, paint); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update version.
private static void drawTriangle(int x, int y, int width, int height, boolean right, boolean high, Paint paint, Canvas canvas) {