I created an image with the following code:
it's working fine,Code:int pix[] = null; Image image = createImage(new MemoryImageSource(width, height, ColorModel.getRGBdefault(), pix, 0, width));
but when I try to draw within the image using the Graphics object... it's gives me an error at the method
image.getGraphics();
so... I'm currently using this code to fix the situation:
Using a blank bmp to load the initial image... the reason I need to load it without a file is that I need to specify the width and height of the new image...!Code:try { image = ImageIO.read(new java.io.File("blank.bmp")); } catch (Exception ex) { }
I need my project done by midnight... any help before that time will greatly be appreciated... if not then I'll resolve to this file load patch...
![]()





Reply With Quote