gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 08:18:55 25 4
gpt4 key购买 nike

给定一个 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com