更改jframe的亮度 [英] Change brightness of jframe

查看:81
本文介绍了更改jframe的亮度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序,它在jframe中以全屏独占模式运行.我正在尝试更改jframe的亮度.我想知道我将如何实现这一目标.我认为可以更改绘制到jframe的图像的所有颜色并使它们更亮,但是仍然不能改变屏幕的实际亮度.程序通常如何实现这样的功能.

I have a program, and it runs in a jframe in full screen exclusive mode. I am trying to change the brightness of the jframe. I was wondering how i would implement this. I thought it might be possible to change all the colors of the images getting drawn to the jframe and make them brighter, but it still does not change how bright the screen actually is. How do programs normally implement something like this.

推荐答案

在绘制循环结束时:

g.setColor(new Color(0, 0, 0, 0.5f)); // 50% darker (change to 0.25f for 25% darker)
g.fillRect(0, 0, width, height);

这篇关于更改jframe的亮度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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