2
Was there any way How to get the color of a Pixel on the x and y coordinates of the screen I specify?
2
Was there any way How to get the color of a Pixel on the x and y coordinates of the screen I specify?
0
A little vague your question, but try to use:
package teste2;
import java.awt.Color;
import java.awt.Robot;
public class teste {
public static void main(String[] args) throws Exception{
Robot robot = new Robot();
Color color = robot.getPixelColor(20, 20);
System.out.println("Red = " + color.getRed());
System.out.println("Green = " + color.getGreen());
System.out.println("Blue = " + color.getBlue());
}
}
But how can I print this? I tried System.out.println(getPixelColor(100,100)); but of error
I’m going to do a test here. Wait!
See if that’s what you need??
I believe that by putting the colors with the Color function you will achieve through the RGB;
Browser other questions tagged java swing jframe
You are not signed in. Login or sign up in order to post.
Swing? Android? Browser?
– Math
Ops It’s with Jframe for Desktop
– Dannark