public static BufferedImage toBufferedImage(Image img)TYPE_INT_ARGB represents an image with 8-bit RGB (RGB) type and supports the alpha rendering and transparency parameter of the class alphaComposite.
{
//if the image is of type BufferedImage
//then we only cast
//because the image passed is of type BufferedImage
if (img instanceof BufferedImage)
{
return (BufferedImage) img;
}
// Create a BufferedImage
BufferedImage bufimage = new BufferedImage(img.getWidth(null),
img.getHeight(null), BufferedImage.TYPE_INT_ARGB);
return bufimage;
}
Please disable your ad blocker and refresh the window to use this website.