src/main/java/com/mxgraph/util/mxUtils.java
public static BufferedImage createBufferedImage(int w, int h,
			Color background, int type)
	{
		BufferedImage result = null;

		if (w > 0 && h > 0)
		{
			result = new BufferedImage(w, h, type);

			// Clears background
			if (background != null)
			{
				Graphics2D g2 = result.createGraphics();
				clearRect(g2, new Rectangle(w, h), background);
				g2.dispose();
			}
		}

		return result;
	}
/**
	 * Creates a buffered image for the given parameters. If there is not enough
	 * memory to create the image then a OutOfMemoryError is thrown.
	 */
Creates a buffered image for the given parameters. If there is not enough
memory to create the image then a OutOfMemoryError is thrown.
Creates a buffered image for the given parameters . If there is not enough memory to create the image then a OutOfMemoryError is thrown .
public static BufferedImage createBufferedImage(int w, int h,
			Color background, int type)
	{
		BufferedImage result = null;
		if (w > 0 && h > 0)
		{
			result = new BufferedImage(w, h, type);
			if (background != null)
			{
				Graphics2D g2 = result.createGraphics();
				clearRect(g2, new Rectangle(w, h), background);
				g2.dispose();
			}
		}
		return result;
	}
public static BufferedImage createBufferedImage ( int w , int h , Color background , int type ) { BufferedImage result = null ; if ( w > 0 && h > 0 ) { result = new BufferedImage ( w , h , type ) ; if ( background != null ) { Graphics2D g2 = result . createGraphics ( ) ; clearRect ( g2 , new Rectangle ( w , h ) , background ) ; g2 . dispose ( ) ; } } return result ; }
Creates a buffered image for the given parameters.
Creates a buffered image for the given parameters .
// Clears background