without having to create a new image. This mean that I wan to read an
image from the disk and add some alpha in it.
for now, I have
private void createStdImage()
{
RenderedImage rImage = JAI.create("fileload", getName());
if (rImage instanceof PlanarImage)
{
PlanarImage pImage = (PlanarImage)rImage;
BufferedImage image = pImage.getAsBufferedImage();
setImageTransparent(image);
}
}
public void setImageTransparent(BufferedImage image)
{
for(int x = 0; x < image.getWidth(); x++)
{
for(int y = 0; y < image.getWidth(); y++)
{
int rgba = image.getRGB(x,y);
rgba = ((rgba & 0x00ffffff) | (255 << 24));
image.setRGB(x,y,rgba);
}
}
}
But this do not work!
Any idea?