I\'m trying to take an image and store it in an array of 16x16 subimages. The image I am using is 512x512 pixels. However, while iterating through the loop, getSubimage() is
From the javadoc
* @param x the X coordinate of the upper-left corner of the
* specified rectangular region
* @param y the Y coordinate of the upper-left corner of the
* specified rectangular region
* @param w the width of the specified rectangular region
* @param h the height of the specified rectangular region
this means the following line is wrong
image.getSubimage(x,y,x + width,y + height);
it should be something like
image.getSubimage(x, y, width, height);
For a full working example take a look at this paste