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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| 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);
Offscreen.getGraphics().drawImage(ptr, x*Crtac.SQUARE_WIDTH, y*Crtac.SQUARE_HEIGHT, null); |