x = startX - xloc; y = startY - yloc; int endX = x + w; int endY = y + h;
int endX = startX + w; int endY = startY + h;  int srcYOffset; int dstYOffset;
   public void setPixels(      int startX,      int startY,      int w,      int h,      int data[],      int off,      int scansize)   {      validate();      int x;      int y;      int localYOffset;      int givenYOffset;      x = startX - xloc;      y = startY - yloc;      int endX = x + w;      int endY = y + h;      for (y = startY; y < endY; y++)      {         localYOffset = y * TILE_SIZE;         givenYOffset = (y - startY) * scansize;         for (x = startX; x < endX; x++)         {            this.data[localYOffset + x] =               data[off + givenYOffset + (x - startX)];         }      }   }