Hello all,
I have some problem when to create a polygon like this:
"IXI", that draw in black and fill with white, It seems something wrong
when fill, the filled color exceeds the edge. what can I do with it?
Any hints would be much appreciated.
Thanks in advance.
Hailong Shen
=====================================
Here the code(can see problem clearly):
Dimension d = new Dimension(15,15);
int[] xpoint = {0, 0, d.width-1, d.width-1};
int[] ypoint = {0, d.height-1, 0, d.height-1};
BufferedImage bi = new BufferedImage(d.width, d.height,
BufferedImage.TYPE_INT_RGB);
Graphics2D big = bi.createGraphics();
GeneralPath pg = new GeneralPath(GeneralPath.WIND_EVEN_ODD,
xpoint.length);
pg.moveTo(xpoint[0], ypoint[0]);
for (int index = 1; index < xpoint.length; index++)
{
pg.lineTo(xpoint[index], ypoint[index]);
};
pg.closePath();
big.setPaint(Color.white);
big.fill(pg);
big.setColor(Color.black);
big.draw(pg);
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 2D Home Page: http://java.sun.com/products/java-media/2D/