如何在 Android 项目中导入 java.awt.BufferedImage?
我看到了建议使用 BufferedImages 来执行我非常感兴趣的增加的问题的答案。
但我找不到导入它的方法,因为它当然不是 SDK 的一部分。其他使用过它的人是如何实现这一目标的?
我基本上是在寻找一种方法来存储我在画布上书写的图形,而不必每次都完全从头开始构建它们。例如,将 drawText() 存储为 BufferedImage 并在每一帧中绘制该图像。
I see answers to questions suggesting the use of BufferedImages for performing increases that I am very interested in.
How can I avoid garbage collection delays in Java games? (Best Practices)
But I cannot find out a way to import it because it is not part of the SDK of course. How has everyone else who have used it achieved this?
I am basically looking for a way to store graphics I am writing on canvas without having to build them totally from stratch each time. For example storing a drawText() as a BufferedImage and drawing that each frame.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
任何建议在 Android 环境中使用 BufferedImage 的答案都是错误的;正如您所注意到的,它不是 Android 环境的一部分。但是,您可以通过使用 位图 获得相同的效率效果。
Any answers suggesting the use of BufferedImage in an Android environment are wrong; as you note, it's not part of the Android environment. However, you can gain the same efficiency effects by using a Bitmap.