Difference between revisions of "Graphics"
From MyWiki
Line 9: | Line 9: | ||
int [ ] y = {60, 105, 105, 110, 95, 95};<br> | int [ ] y = {60, 105, 105, 110, 95, 95};<br> | ||
g.drawPolygon(x, y, 6);<br> | g.drawPolygon(x, y, 6);<br> | ||
− | drawPolygon(int x[ ], int y[ ], int n) | + | drawPolygon(int x[ ], int y[ ], int n) |
Used to draw a polygon created by n line segments. The command will close the polygon. (x-coordinates go in one array with accompanying y-coordinates in the other)<br> | Used to draw a polygon created by n line segments. The command will close the polygon. (x-coordinates go in one array with accompanying y-coordinates in the other)<br> |
Revision as of 17:39, 17 November 2014
Java AWT
g.drawLine(35, 45, 75, 95);
g.drawRect(35, 45, 25, 35);
g.drawRoundRect(35,45,25,35,10,10);
g.drawOval(25, 35, 25, 35);
g.drawArc(35, 45, 75, 95, 0, 90);
int [ ] x = {20, 35, 50, 65, 80, 95};
int [ ] y = {60, 105, 105, 110, 95, 95};
g.drawPolygon(x, y, 6);
drawPolygon(int x[ ], int y[ ], int n)
Used to draw a polygon created by n line segments. The command will close the polygon. (x-coordinates go in one array with accompanying y-coordinates in the other)