I am writing a MouseListener click event, when I click on a JLabel it will give me the RGB value of the pixel that I clicked.
I can use
mybufferedImage.getRGB(e.getPoint().x, e.getPoint().y
However, I am having trouble retrieving the Icon as a BufferedImage.
I KNOW that I can retrieve the Icon and then convert to BufferedImage, but I am wondering if there is an equivalent way of getting the RGB value of the Icon without having to convert to BufferedImage? My main concern is performance, every time I retrieve the RGB value I don't want to have to convert the entire image, especially when I am working with very large images.
Thank you
See Question&Answers more detail:os