Java-红色,绿色,蓝色以获取RGB [英] Java - Red, Green, Blue to getRGB
本文介绍了Java-红色,绿色,蓝色以获取RGB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
通过使用 BufferedImage
对象调用 getRGB(int x,int y)
,可以得到一个负数
By calling getRGB(int x, int y)
with a BufferedImage
object, one gets a single, negative number.
如何将三个不同的值(红色,绿色和蓝色)转换成这个单个的负数?
How can I convert three different values (a red, a green, and a blue) into this single, negative number?
推荐答案
使用Color类:
new Color(r, g, b).getRGB()
这篇关于Java-红色,绿色,蓝色以获取RGB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文