码迷,mamicode.com
首页 > 其他好文 > 详细

e654. 获得文本的缩略图

时间:2018-09-02 23:54:06      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:outline   sha   获得   return   ble   aci   padding   pad   examples   

Shape getTextShape(Graphics2D g2d, String str, Font font) {
        FontRenderContext frc = g2d.getFontRenderContext();
        TextLayout tl = new TextLayout(str, font, frc);
        return tl.getOutline(null);
    }

 

Related Examples

e654. 获得文本的缩略图

标签:outline   sha   获得   return   ble   aci   padding   pad   examples   

原文地址:https://www.cnblogs.com/borter/p/9575446.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!