GraphicsConfiguration: createCompatibleImage(int width, int height, int transparency) : GraphicsConfiguration « java.awt « Java by API






GraphicsConfiguration: createCompatibleImage(int width, int height, int transparency)

  
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Transparency;
import java.awt.image.BufferedImage;

public class Main {
  public static void main(String[] argv) throws Exception {

    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();
    GraphicsConfiguration gc = gs.getDefaultConfiguration();

    // Create an image that does not support transparency
    BufferedImage bimage = gc.createCompatibleImage(100, 100, Transparency.OPAQUE);

  }
}

   
    
  








Related examples in the same category

1.GraphicsConfiguration: getBounds()
2.GraphicsConfiguration: getColorModel()