Possible Duplicate:
How to calculate the area of a java.awt.geom.Area?
我不知道如何开始,希望有人能提供帮助?
我有一个已关闭的java.awt.geom.GeneralPath
我尝试测量正方形(squarepixel (point ^ 2
) 中的面积)。
最佳答案
由于 GeneralPath
实现了 Shape
,因此您可以计算每个像素 contains()
为 true
的次数在 getBounds()
返回的 Rectangle
中。如果需要,您可以通过 AffineTransform
的 createTransformedShape()
方法进行缩放。
关于java - 求封闭 GeneralPath 所包围的区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14175685/