Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 607
  • Last Modified:

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?
0
darkpegasus5
Asked:
darkpegasus5
1 Solution
 
objectsCommented:
you could try:

g.setClip(poly);
g.drawImage(...
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now