transparent pic has white background

im using this

try{

Image image = (Toolkit.getDefaultToolkit().getImage(new URL("http://scapeserver.nationvoice.com/2.png")));

anIntArray1439 =newint[anInt1440 * anInt1441];

PixelGrabber pixelgrabber

=new PixelGrabber(image, 0, 0, anInt1440, anInt1441,

anIntArray1439, 0, anInt1440);

pixelgrabber.grabPixels();

}catch (Exception e)

{

e.printStackTrace();

}

but when i load it loads and displays it

comes up with a white background and not transparent

any ideas?

[883 byte] By [aaa801a] at [2007-11-27 5:31:05]
# 1

import java.awt.*;

import java.awt.image.BufferedImage;

import java.io.*;

import javax.imageio.ImageIO;

import javax.swing.*;

public class PNGLoading {

private BufferedImage loadNewWay(String path) throws IOException {

return ImageIO.read(new File(path));

}

private Image loadOldWay(String path) {

ImageIcon icon = new ImageIcon(path);

int status = icon.getImageLoadStatus();

if((status & MediaTracker.COMPLETE) != MediaTracker.COMPLETE)

System.out.println("load trouble: " + status);

return icon.getImage();

}

public static void main(String[] args) throws IOException {

String path = "2.png";

PNGLoading test = new PNGLoading();

JPanel panel = new JPanel(new GridLayout(1,0));

panel.setBackground(new Color(200,220,240));

panel.add(new JLabel(new ImageIcon(test.loadNewWay(path))));

panel.add(new JLabel(new ImageIcon(test.loadOldWay(path))));

JOptionPane.showMessageDialog(null, panel, "",

JOptionPane.PLAIN_MESSAGE);

}

}

crwooda at 2007-7-12 14:55:55 > top of Java-index,Security,Cryptography...
# 2

Trying to load transparent sprites huh? Well just so you know you are not the only one. You are looking in the wrong place. The problem is that it is loading the background and adding it into the image. You need to stop your program from loading the background and adding it to the image (you know what i mean)

James,

KillerScapea at 2007-7-12 14:55:55 > top of Java-index,Security,Cryptography...