BufferedImages Problem

I recently lost all of my programs, and have had to start from scratch, and now I am running into an interesting little problem with my images. I can’t get them to load properly. They look messed up (hard to explain), but the colors are gone, and the image itself is all chopped up. I am pretty sure I am using the same code as before, too. I have looked around and cannot even find anyone with the same problem. I’ve been trying to fix it myself for hours with no luck.

Here’s the code I’m using to get and convert the images to managed images:


try
        {
            BufferedImage im = ImageIO.read(getClass().getResource(spriteNames[a]));
            int transparency = im.getColorModel().getTransparency();
            BufferedImage copy = gc.createCompatibleImage(im.getWidth(), im.getHeight(), transparency);
            Graphics2D g2d = copy.createGraphics();
            g2d.drawImage(im, 0, 0, null);
            g2d.dispose();
            return copy;
        }
        catch (Exception e)
        {
            return null;
        }

Tell me if you need a screenshot of what the messed up images look like.

PS- I would also like to mention that the images are also the wrong size. When I go FSEM, I tell the program to put the images in a grid 9X15, for my 1440X900 monitor. The vertical portion works fine, but my images seem to be stretched out, only showing 11.5 across. They are 96 pixels wide. 1440/96 = 15, right? Well, right now, according to my computer, it is 1440/72=15. It’s retarded.

if you work with BufferedImage’s, the MediaTracker will solve your problem of loading and scaling. If there are not-managed images, the drawImage(image, 0, 0, (IMAGEOBSERVER)) mustn’t miss an image observer component instance, or the loading will not work well.

Actually, I just figured out the problem. I had to change the bitdepth of the FSEM to 16, not 32. I don’t remember having to do that last time, though. Anyway, everything is fixed, i.e. the images are the proper size and are displaying correctly. Thanks for responding, though.