Painting over BufferedImages
Hi, I´m trying to mark some positions in my PlanarImage.
First I change my PlanarImage to BufferedImage (because PlanarImage doesn´t implement getGraphics() method).
Then I get graphics context:
Graphics2D g2d = (Graphics2D) myBufferedImage.getGraphics();
g2d.setColor(new Color(255, 0, 0, 200)); //red
g2d.drawLine(x - 5, y, x + 5, y);
g2d.drawLine(x, y - 5, x, y + 5);
My question is: because I´m showing just one band in myBufferedImage, my marks look always black (despite I call red color). Is there any way to draw my marks in any other color?
I´ve tryed getting graphic context from my display or my frame, and it paints my marks red, but they disappear when scrolling the image.