base/common/src/main/com/thesett/common/swing/surface/Surface.java
protected BufferedImage createBufferedImage(int w, int h, int imgType)
    {
        BufferedImage bi = null;

        if (imgType == 0)
        {
            bi = (BufferedImage) createImage(w, h);
        }
        else if ((imgType > 0) && (imgType < 14))
        {
            bi = new BufferedImage(w, h, imgType);
        }
        else if (imgType == 14)
        {
            bi = createBinaryImage(w, h, 2);
        }
        else if (imgType == 15)
        {
            bi = createBinaryImage(w, h, 4);
        }
        else if (imgType == 16)
        {
            bi = createSGISurface(w, h, 32);
        }
        else if (imgType == 17)
        {
            bi = createSGISurface(w, h, 16);
        }

        // Store the buffered image size
        biw = w;
        bih = h;

        return bi;
    }
protected BufferedImage createBufferedImage(int w, int h, int imgType)
    {
        BufferedImage bi = null;

        if (imgType == 0)
        {
            bi = (BufferedImage) createImage(w, h);
        }
        else if ((imgType > 0) && (imgType < 14))
        {
            bi = new BufferedImage(w, h, imgType);
        }
        else if (imgType == 14)
        {
            bi = createBinaryImage(w, h, 2);
        }
        else if (imgType == 15)
        {
            bi = createBinaryImage(w, h, 4);
        }
        else if (imgType == 16)
        {
            bi = createSGISurface(w, h, 32);
        }
        else if (imgType == 17)
        {
            bi = createSGISurface(w, h, 16);
        }

        // Store the buffered image size
        biw = w;
        bih = h;

        return bi;
    }
protected BufferedImage createBufferedImage ( int w , int h , int imgType ) { BufferedImage bi = null ; if ( imgType == 0 ) { bi = ( BufferedImage ) createImage ( w , h ) ; } else if ( ( imgType > 0 ) && ( imgType < 14 ) ) { bi = new BufferedImage ( w , h , imgType ) ; } else if ( imgType == 14 ) { bi = createBinaryImage ( w , h , 2 ) ; } else if ( imgType == 15 ) { bi = createBinaryImage ( w , h , 4 ) ; } else if ( imgType == 16 ) { bi = createSGISurface ( w , h , 32 ) ; } else if ( imgType == 17 ) { bi = createSGISurface ( w , h , 16 ) ; } // Store the buffered image size biw = w ; bih = h ; return bi ; }
Generates a fresh buffered image of the appropriate type.

@param  w       The image width.
@param  h       The image height.
@param  imgType The image type. Note that this should be two less than the image types defined as constants in
this class to correspond with the image type constants defined in BufferedImage. This class uses
0 for auto image type selection and 1 for direct to screen.

@return A buffered image of the specifed size and type.
Generates a fresh buffered image of the appropriate type .