public void getRGB(int []argb, int offset, int scanlength,
int x, int y, int width, int height) {
if (width <= 0 || height <= 0)
return;
if (x < 0 || y < 0 || x + width > getWidth() || y + height > getHeight())
throw new IllegalArgumentException("Specified area exceeds bounds of image");
if ((scanlength < 0? -scanlength:scanlength) < width)
throw new IllegalArgumentException("abs value of scanlength is less than width");
if (argb == null)
throw new NullPointerException("null rgbData");
if (offset < 0 || offset + width > argb.length)
throw new ArrayIndexOutOfBoundsException();
if (scanlength < 0) {
if (offset + scanlength*(height-1) < 0)
throw new ArrayIndexOutOfBoundsException();
} else {
if (offset + scanlength*(height-1) + width > argb.length)
throw new ArrayIndexOutOfBoundsException();
}
try {
(new PixelGrabber(img, x, y, width, height, argb, offset, scanlength)).grabPixels();
} catch (InterruptedException e) {
Logger.error(e);
}
}