Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to clip an image with a polygon in java?

Posted on 2004-09-29
1
Medium Priority
?
603 Views
Last Modified: 2011-04-14
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
Comment
Question by:darkpegasus5
1 Comment
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 12177380
you could try:

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question