Topic: 求教:在Java2D中如何实现文字以竖排的方式画在画布上? |
Print this page |
1.求教:在Java2D中如何实现文字以竖排的方式画在画布上? | Copy to clipboard |
Posted by: sportscar Posted on: 2004-10-18 14:26 用TextLayout文字只能以横排方式打印,怎样才能实现竖排打印呢?
请指教,谢谢! |
2.Re:求教:在Java2D中如何实现文字以竖排的方式画在画布上? [Re: sportscar] | Copy to clipboard |
Posted by: ljy0000 Posted on: 2004-10-18 15:21 protected void paintComponent(Graphics g) { super.paintComponent; Dimension dimension = getSize(); Graphics2D g2=(Graphics2D) g; g2.rotate(Math.PI/2,dimension.width / 2, dimension.height / 2); g2.drawString(string, dimension.width / 2, dimension.height / 2); } |
3.Re:求教:在Java2D中如何实现文字以竖排的方式画在画布上? [Re: sportscar] | Copy to clipboard |
Posted by: sportscar Posted on: 2004-10-18 15:52 谢谢您, 我想要的是如“安定门“这样的竖排方式,而不是“建国门”这样的方式,讲讲思路也行啊 |
4.Re:求教:在Java2D中如何实现文字以竖排的方式画在画布上? [Re: sportscar] | Copy to clipboard |
Posted by: kavinwang Posted on: 2004-10-18 22:05 一般是取得单个字的高和宽,然后循环进行绘制,其间需要注意和修改绘制的位置 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |