java - 将 Image 对象转换为 BufferedImage 对象

标签 java image-processing bufferedimage

给定一个 Image 对象,如何在不使用任何图形 Material 的情况下将其转换为 BufferedImage 对象?

谢谢。

(附言,我使用的是 Java ImageIO 库)

最佳答案

作为this article (它提供了一个从图像创建 BufferedImage 的示例)指出:

An Image object cannot be converted to a BufferedImage object. The closest equivalent is to create a buffered image and then draw the image on the buffered image. This example defines a method that does this.

关于java - 将 Image 对象转换为 BufferedImage 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1953769/

相关文章:

java - 既然 XMLBeans 已经退役了,用什么来代替它呢?

python - Tensorflow 在批量处理时混合图像和标签

java - 序列化包含 BufferedImages 的对象

java - hibernate criteria projection 获取连接表的列

java - 使用 log4j2.xml 进行 Elasticsearch 配置

java - 等同于 GWT 中的 request.getRemoteUser()?

c++ - 无需任何库即可从像素值获取 RGB channel

java - 剪出文字形状的图片

Java - 从图像中获取像素数组

java - 使用 datainput/-outputstream 通过 java 套接字发送 jpg-图像时出现问题