如何绘制在AWT文本周围的轮廓? [英] How to draw an outline around text in AWT?

查看:159
本文介绍了如何绘制在AWT文本周围的轮廓?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

怎样绘制围绕AWT任何文本大纲,类似这样的画面的东西吗?

How can I draw an outline around any text in AWT, something similar to this picture?

推荐答案

两个例子

字体,则TextLayout和的AffineTransform

输出将是的BufferedImage ,用于AWT组件的使用方法的paint(),对于摇摆JComponent上有 paintComponet()

output from this paint would be the BufferedImage, for AWT Components use method paint(), for Swing JComponents is there paintComponet()

另外,从在评论链接code:

Also, from code linked in a comment:

这篇关于如何绘制在AWT文本周围的轮廓?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆