Hi,
I really don’t know what else do I have to do to make a simple image to be drawn on the offscreen. I have two images in the same directory where the application is. I tried both GIF and BMP and neither seem to have worked. I know the image is loaded cause I tried getImage().getWidth(null) and it was 32, which is the width of the image.
When I try to draw with fillRect() it works ok, it draws rectangles. But when I try drawImage() I get a blank screen.
ImageIcon Tile[] = new ImageIcon[2];
Tile[0] = new ImageIcon(new URL("file:///C:/java/eclipse/workspace/DrawTest/tile1.gif"));
// ...
ptr = Tile[0].getImage();
Offscreen.getGraphics().setColor(Color.BLUE);
// this works //Offscreen.getGraphics().fillRect(x*Crtac.SQUARE_WIDTH,y*Crtac.SQUARE_HEIGHT,30,30);
// this does not work!
Offscreen.getGraphics().drawImage(ptr, x*Crtac.SQUARE_WIDTH,
y*Crtac.SQUARE_HEIGHT, null);