如何在 JFrame 中显示 BufferedImage? [英] How can I display a BufferedImage in a JFrame?

查看:27
本文介绍了如何在 JFrame 中显示 BufferedImage?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在同一个 JFrame 中显示同一图像的变体,例如在 JFrame 中显示一个图像,然后将其替换为同一图像的灰度.

I want to display variations of the same image in the same JFrame, for example display an image in JFrame, then replace it with gray scale of the same image.

推荐答案

每次更新图像时都必须重新绘制 JFrame.

You will have to repaint the JFrame whenever you update the image.

这是一个关于该主题的简单谷歌带来的内容:(我使用这些教程进行所有 Java 编码)

Here is what a simple google on the topic brings up: (I use those tutorials for all my Java coding)

Java 教程:绘制图像

这篇关于如何在 JFrame 中显示 BufferedImage?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆