public WritableRaster createCompatibleWritableRaster(int w,int h){
  if (w <= 0 || h <= 0) {
    throw new RasterFormatException("negative " + ((w <= 0) ? "width" : "height"));
  }
  SampleModel sm=sampleModel.createCompatibleSampleModel(w,h);
  return new ShortBandedRaster(sm,new Point(0,0));
}

public WritableRaster createCompatibleWritableRaster ( int w , int h ) { if ( w <= 0 || h <= 0 ) { throw new RasterFormatException ( "negative " + ( ( w <= 0 ) ? "width" : "height" ) ) ; } SampleModel sm = sampleModel . createCompatibleSampleModel ( w , h ) ; return new ShortBandedRaster ( sm , new Point ( 0 , 0 ) ) ; }
creates a raster with the same layout but using a different width and height , and with new zeroed data arrays .
