GraphicsEnvironment ge = GraphicsEnvironment
.getLocalGraphicsEnvironment();
GraphicsDevice gs = ge.getDefaultScreenDevice();
GraphicsConfiguration gc = gs.getDefaultConfiguration();
BufferedImage outputImg = gc.createCompatibleImage(100, 70,
Transparency.BITMASK);
Graphics2D g = outputImg.createGraphics();
// g.setClip(new Rectangle(new Dimension(40, 40)));
g.drawImage(outputImg, null, 0, 0);