How to clip an image with a polygon in java?

I have an object that extends Polygon (a hexagon).
I have a larger rectangular Image that I would like to clip to fit into the Polygon.

The Polygon has a stroke width of 2. How do I clip the Image so that it fits neatly inside the Polygon?
LVL 1
darkpegasus5Asked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
you could try:

g.setClip(poly);
g.drawImage(...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.