   [java] createImage + MemoryImageSource - getGraphics() ?
  HiI have a class, A. This class doesn't inherit another class.When I create instances of this class, I want to create an image withinthe constructor.I then use this method: Image img = Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, pixels, 0, w));Is there a way to get a Graphics object from the image returned from createImage above?If I call "img.getGraphics()" I get the error: "getGraphics() not valid for images created with createImage(producer)"Kind Regards   
  GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().createCompatableImage(width, height);   ;  Hi CaptainThat method is abstract, it doesn't work. :|Is there an option where I still can use my raw-pixel array to fill the bitmap?And have the ability to "getGraphics()"?Kind Regards   ;  You are using it wrong.  Here is code that works.import java.awt.GraphicsEnvironment;import java.awt.image.BufferedImage;public class Test {    public static void main(String[] args) {   BufferedImage im = GraphicsEnvironment.getLocalGraphicsEnvironment(). getDefaultScreenDevice().getDefaultConfiguration().createCompatibleImage(400, 400);   System.out.println(im);    }};  Thanks!   