Java – get the boundary rectangle of drawstring?
•
Java
Is there any way to get the bounding box it will occupy given the current setting font and string of graphics object?
thank you
Solution
I prefer textlayout #getboundaries(); However, if you already have a graphics context, the string boundary method of fontmetrics is very convenient
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码