Why does ToolkitImage getBufferedImage() return a null?
问题 I want to convert an Image to a BufferedImage . I know the following: Image tmp; ... //read, scale BufferedImage buffered = new BufferedImage(SMALL_SIZE, SMALL_SIZE, BufferedImage.TYPE_INT_RGB); buffered.getGraphics().drawImage(tmp, 0, 0, null); But it's really slow. I need BufferedImage , because I have to get pixel color data. I found a possible way to do it, without drawing: ToolkitImage ti = (ToolkitImage) tmp; BufferedImage buffered = tmp.getBufferedImage(); But it always returns null .