Hi guys !
I face an unexpected problem :o . I simply can’t draw properly a polygon thanks to the drawPolygon method …
http://tanks-game.ifrance.com/Untitled-1.bmp
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f));
g2d.setColor(Color.GREEN);
int[] xVertex = {1,36,36,1,1};
int[] yVertex = {1,1,36,36,1};
g2d.drawPolygon(new Polygon(xVertex,yVertex,5));
//35X35 image
g2d.drawImage(myImage,1,1,null);
There is two problems :
- The green rectangle should be wrapping the image but it doesnt at all.
- The pixel in the top-right corner isn’t drawn …
I really don’t understand, please help me ???