Java绘制文本教程(全面指南
绘制文本的代码如下:layout.draw(g, (float)loc.getX(), (float)loc.getY()); //设置边框Rectangle2D bounds = layout.getBounds(); bounds.setRect(bounds.getX()+loc.getX(), bounds.getY()+loc.getY(), bounds.getWidth(), bounds.getHeight()); g.draw(bounds); layout = new TextLayout(str2,frc); g.setColor(Color.red); layout.draw(g,20,80); } }
9.2MB
文件大小:
评论区