Graphics.fillPolygon

Graphics.fillPolygon

Class Overview | Class Members | This Package | All Packages

Syntax 1
public abstract void fillPolygon( int xPoints[], int yPoints[], int nPoints )
Parameters
xPoints
a an array of x coordinates.
yPoints
a an array of y coordinates.
nPoints
a the total number of points.
Description
Fills a closed polygon defined by arrays of x and y coordinates.

This method draws the polygon defined by nPoint line segments, where the first nPoint - 1 line segments are line segments from (xPoints[i - 1], yPoints[i - 1]) to (xPoints[i], yPoints[i]), for 1 ≤ i ≤ nPoints. The figure is automatically closed by drawing a line connecting the final point to the first point, if those points are different.

The area inside the polygon is defined using an even-odd fill rule, also known as the alternating rule.

See Also
drawPolygon



Syntax 2
public void fillPolygon( Polygon p )
Parameters
p
the polygon to fill.
Description
Fills the polygon defined by the specified Polygon object with the graphics context's current color.

The area inside the polygon is defined using an even-odd fill rule, also known as the alternating rule.

See Also
drawPolygon