Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to clip an image with a polygon in java?

Posted on 2004-09-29
1
579 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MySqlDump not dumping triggers 1 43
JAVA API design with micro service cloud in mind 1 41
ejb entity bean example issue 2 16
collection output issue 9 36
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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.

792 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