Solved

How to clip an image with a polygon in java?

Posted on 2004-09-29
1
575 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 125 total points
ID: 12177380
you could try:

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

706 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now