I have work on an application that captures screenshots and creates video from captured images. But the problem is that when you create a video, the colors in the video are very pinkish. I think this is because I manipulated the captured images to show the cursor using the type BufferedImage.TYPE_3BYTE_BGR. Can someone tell me how to solve this problem, I want the video color to be the same as the actual color of the screen.
To capture the image on the screen, I do the following:
Robot robot = new Robot();
Rectangle captureSize = new Rectangle(screenBounds);
return robot.createScreenCapture(captureSize);
To manage the images, I do the following:
image = new BufferedImage(sourceImage.getWidth(), sourceImage.getHeight(), BufferedImage.TYPE_3BYTE_BGR);
if (true) {
int x = MouseInfo.getPointerInfo().getLocation().x - 25;
int y = MouseInfo.getPointerInfo().getLocation().y - 37;
Graphics2D graphics2D = sourceImage.createGraphics();`enter code here`
graphics2D.drawImage(SimpleWebBrowserExample.m_MouseIcon, x, y, 48, 48, null);
}
image.getGraphics().drawImage(sourceImage, 0, 0, null);
return image;
please tell me how to get images with a color similar to the actual color on the screen.
Thank.
source
share