没有透明度的图像只是在其他笔记本电脑中不可见.
另外,当我创建一个新的Eclipse项目时:
>当我将粘贴代码复制到单独的类文件中时,在具有相同代码和项目设置的机器上,它可以在我的机器上正常运行,但在其他机器上则无法正常工作.
> bin中的图像未复制,我必须分别复制图像.
这是用于透明度的代码.
public static class Transparency
{
public static Image makeColorTransparent(Image im, final Color color)
{
ImageFilter filter = new RGBImageFilter()
{
public int markerRGB = color.getRGB() | 0xFF000000;
public final int filterRGB(int x, int y, int rgb)
{
if ( ( rgb | 0xFF000000 ) == markerRGB )
{
// Mark the alpha bits as zero - transparent
return 0x00FFFFFF & rgb;
}
else
{
// nothing to do
return rgb;
}
}
};
ImageProducer ip = new FilteredImageSource(im.getSource(), filter);
return Toolkit.getDefaultToolkit().createImage(ip);
}
}
我想做多人游戏.因此至关重要的是它应该可以在其他笔记本电脑上运行…