user interface - How to obtain bounding box of transformed text(java)? -
I currently have a text object that I need to set its limits. I get the text matrix of text I used to use the graphics object that I'm trying to attract, but since I added the functionality to rotate the object (and possibly more) I would like to get an edge of this object I should see the way I have seen many places and nothing really is not working for me yet. This is my most current effort:
// This is the bounding box edges 0: left , 1: right 2: top 3: Returns for the intrate below [] = New int [4]; //this.transform is the text object for AffineTransform (currently only // rotated) FontRenderContext frc = new FontRenderContext (this.transform, true, false); TextLayout tl = new text layout (this is typed text, this.font, frc); Rectangle 2dbb = tl.jetband (); ToReturn [0] = (int) (bb.getX ()); ToReturn [1] = (int) (BB.getX) + BB.getWidth ()); ToReturn [2] = (int) (BB.getY ()); ToReturn [3] = (int) (BB.getY) + BB.GhatHight ());
Is this the correct way to get the bounding box for the converted text?
No, for this scale in typographical context, to scale the typographic digits for pixels, efine transform
is supplied. "You want to be able to use the range to get results.
Comments
Post a Comment