![]() |
Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
If you have arbitrary shapes, then one simple trick is to just calculate the average position (x & y) of all the pixels inside the bounds of a particular shape. That would give you the weighted center. For this, the base shape object should have a contains(x,y) type method that allows you to test whether a given pixel is in the shape's region or not.
Replies:
|
Sponsored Links
|