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

查看:292
本文介绍了如何在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.

这是一个有关该主题的简单google提出的内容:(我将这些教程用于我的所有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天全站免登陆