int endX = startX + w; int endY = startY + h;  Object rgbElem = null; for (int y=startY; y<endY; y++) { int xoffset = offset; for (int x=startX; x<endX; x++) { int argb = argbArray[xoffset++]; rgbElem = colorModel.getDataElements(argb, rgbElem); raster.setDataElements(x, y, rgbElem); } offset += scanlineStride; }
Object rgbElem = colorModel.getDataElements(argb, null); raster.setDataElements(x, y, rgbElem);
  public void setRGB(int startX, int startY, int w, int h,		     int[] argbArray, int offset, int scanlineStride)  {    int endX = startX + w;    int endY = startY + h;        Object rgbElem = null;    for (int y=startY; y<endY; y++)      {	int xoffset = offset;	for (int x=startX; x<endX; x++)	  {	    int argb = argbArray[xoffset++];	    rgbElem = colorModel.getDataElements(argb, rgbElem);	    raster.setDataElements(x, y, rgbElem);	  }	offset += scanlineStride;          }  }