Below example will demonstrate you the createCompatibleImage() method of GraphicsConfiguration class:
Code:
import java.awt.GraphicsConfiguration;
import java.awt.Transparency;
import java.awt.image.BufferedImage;
public class GCMain
{
public static void main(String[] arghv) throws Exception
{
GraphicsEnvironment je = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice js = je.getDefaultScreenDevice();
GraphicsConfiguration jc = gs.getDefaultConfiguration();
BufferedImage bimage = jc.createCompatibleImage(100, 100, Transparency.OPAQUE);
}
}
Bookmarks