}
private long createPixmap(Image image) {
int w = image.getWidth(null);
int h = image.getHeight(null);
XVolatileImage xvi = (XVolatileImage) GraphicsEnvironment.
getLocalGraphicsEnvironment().getDefaultScreenDevice().
getDefaultConfiguration().createCompatibleVolatileImage(w, h);
Graphics g = xvi.getGraphics();
g.setColor(Color.lightGray);
g.fillRect(0, 0, w, h);
g.drawImage(image, 0, 0, null);
g.dispose();
return xvi.getPixmap();
}