我们可以在j2me中的Canvas上垂直绘制文本吗

发布于 2024-10-09 05:15:43 字数 133 浏览 4 评论 0原文

我正在为诺基亚 N97 开发 j2me 项目。我想垂直编写测试,即垂直旋转我的文本。我正在使用 Graphics.DrawString();方法在画布上绘制文本。

任何人都可以帮助我如何在画布上绘制和旋转文本。

提前致谢

I am working on j2me project for nokia N97.I want to write the test vertically i.e rotate my text vertically.I am using Graphics.DrawString(); method to draw text on canvas.

Can any one help me how to draw and rotate text on canvas.

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一梦等七年七年为一梦 2024-10-16 05:15:43

您可以创建所需文本大小的可变Image(使用Font.stringWidth()Font.getHeight()作为尺寸),将文本绘制到 ImageGraphics 对象上,使用图像实例化 Sprite,使用 旋转它Sprite.setTransform(Sprite.TRANS_ROT90),最后使用Sprite.paint()进行绘制。

有关所有这些的更多信息,请参见 MIDP2规格

华泰

You can create a mutable Image of the size of the text you require (use Font.stringWidth() and Font.getHeight() for the dimensions), draw the text on to the Image's Graphics object, use the image to instantiate a Sprite, rotate it using Sprite.setTransform(Sprite.TRANS_ROT90), and finally draw it using Sprite.paint().

More info on all of these in the MIDP2 spec.

HTH

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文