* @return VolatileImage created
* @see java.awt.image.VolatileImage
* @see #_getTransparency(int)
*/
public static VolatileImage createVolatileImage(Dimension size, int type) {
VolatileImage vdata = null;
GraphicsConfiguration gc = JXAenvUtils._defaultGC;
Dimension d = new Dimension(Math.max(1, Math.abs(size.width)), Math.max(1, Math.abs(size.height)));
do {
Image i = ImagePool.getInstance().findVacantImage(VOLATILE, type, d);
vdata = i == null ? gc.createCompatibleVolatileImage(d.width, d.height, type) : (VolatileImage) i;
Graphics2D g = vdata.createGraphics();
Color c = g.getColor();
g.setColor(Color.WHITE);
g.setComposite(AlphaComposite.getInstance(AlphaComposite.DST_IN, 0f));
g.fillRect(0, 0, d.width, d.height);
g.setComposite(AlphaComposite.SrcOver);