Code example for RasterFormatException

0
        // If r.x (or r.y) is > 0, then we need to create an image that 
        // includes the translation. 
        int w = r.x + r.width;
        int h = r.y + r.height;
        if (w <= 0) {
            throw new RasterFormatException("Transformed width ("+w+
                                            ") is less than or equal to 0."); 
        } 
        if (h <= 0) {
            throw new RasterFormatException("Transformed height ("+h+
                                            ") is less than or equal to 0."); 
        } 
 
        if (dstRegion != null){
        	w = dstRegion.width;
        	h = dstRegion.height;
        } 
 
        if (destCM == null) {
            ColorModel cm = src.getColorModel();