I'm using this code to display a portion of my desktop into a window. In the image below, you can see the actual color of my desktop compared to what is displayed.
How can I correct this?
public static void main(String args[]) throws Exception {
int x = 0, y = 0, w = 1024, h = 768;
FFmpegLogCallback.set();
FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(":1.0+" + x + "," + y);
grabber.setFormat("x11grab");
grabber.setImageWidth(w);
grabber.setImageHeight(h);
grabber.start();
CanvasFrame frame = new CanvasFrame("Screen Capture");
while (frame.isVisible()) {
frame.showImage(grabber.grab());
}
frame.dispose();
grabber.stop();
}
I'm using this code to display a portion of my desktop into a window. In the image below, you can see the actual color of my desktop compared to what is displayed.
How can I correct this?