1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| /**
* Create a PixelGrabber object to grab the (x, y, w, h) rectangular
* section of pixels from the specified image into the given array.
* The pixels are stored into the array in the default RGB ColorModel.
* The RGB data for pixel (i, j) where (i, j) is inside the rectangle
* (x, y, w, h) is stored in the array at
* <tt>pix[(j - y) * scansize + (i - x) + off]</tt>.
* @see ColorModel#getRGBdefault
* @param img the image to retrieve pixels from
* @param x the x coordinate of the upper left corner of the rectangle
* of pixels to retrieve from the image, relative to the default
* (unscaled) size of the image
* @param y the y coordinate of the upper left corner of the rectangle
* of pixels to retrieve from the image
* @param w the width of the rectangle of pixels to retrieve
* @param h the height of the rectangle of pixels to retrieve
* @param pix the array of integers which are to be used to hold the
* RGB pixels retrieved from the image
* @param off the offset into the array of where to store the first pixel
* @param scansize the distance from one row of pixels to the next in
* the array
*/
public PixelGrabber(Image img, int x, int y, int w, int h,
int[] pix, int off, int scansize) {
this(img.getSource(), x, y, w, h, pix, off, scansize);
} |
Partager