PlayN - 在图像上绘图
我最近开始使用 PlayN 进行一个业余爱好项目,现在偶然发现了一个问题。
我想在图像上绘制一些线条和文本并保存该图像以供以后使用。 在Java中,我只会制作一个BufferedImage并使用它的graphicsBuffered进行绘制,但我在PlayN中找不到任何类似的解决方案。
这有可能吗?如果可能的话,如何实现?
我需要以某种方式将 BufferedImage 转换为 Image ,反之亦然。
I have recently started using PlayN for a hobby project and has now stumbled upon a problem.
I would like to draw some lines and text onto an Image and save this image for later use.
In Java I would just make a BufferedImage and use its graphicsBuffered to draw upon, but I can not find any similar solution in PlayN.
Is this at all possible, and if so how ?
I somehow need to be able to convert a BufferedImage to an Image and the other way around.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建一个 CanvasImage,将图像绘制到 CanvasImage 上,然后在其上绘制文本和线条。然后,您可以使用 ImageLayer 中的 CanvasImage 将其放入场景图中。
Create a CanvasImage, draw your image onto the CanvasImage, and then draw your text and lines on top of it. You can then use the CanvasImage in an ImageLayer to put it into your scene graph.