*                </ul>
	 * @exception SWTException
	 *                <ul>
	 *                <li>ERROR_UNSUPPORTED_DEPTH if the depth is not one of 1,
	 *                2, 4, 8 (For higher depths, use the int[] version of this
	 *                method.)</li>
	 *                </ul>
	 */
	public void setPixels(int x, int y, int putWidth, byte[] pixels,
			int startIndex) {
		if (pixels == null)
			SWT.error(SWT.ERROR_NULL_ARGUMENT);
		if (putWidth < 0 || x >= width || y >= height || x < 0 || y < 0)
			SWT.error(SWT.ERROR_INVALID_ARGUMENT);
		if (putWidth == 0)
			return;
		int index;
		int theByte;
		int mask;
		int n = putWidth;
		int i = startIndex;
		int srcX = x, srcY = y;
		switch (depth) {
		case 8:
			index = (y * bytesPerLine) + x;
			for (int j = 0; j < putWidth; j++) {
				data[index] = (byte) (pixels[i] & 0xFF);
				i++;
				srcX++;
				if (srcX >= width) {
					srcY++;
					index = srcY * bytesPerLine;
					srcX = 0;
				} else {
					index++;
				}
			}
			return;
		case 4:
			index = (y * bytesPerLine) + (x >> 1);
			boolean high = (x & 0x1) == 0;
			while (n > 0) {
				theByte = pixels[i] & 0x0F;
				if (high) {
					data[index] = (byte) ((data[index] & 0x0F) | (theByte << 4));
				} else {
					data[index] = (byte) ((data[index] & 0xF0) | theByte);
				}
				i++;
				n--;
				srcX++;
				if (srcX >= width) {
					srcY++;
					index = srcY * bytesPerLine;
					high = true;
					srcX = 0;
				} else {
					if (!high)
						index++;
					high = !high;
				}
			}
			return;
		case 2:
			byte[] masks = { (byte) 0xFC, (byte) 0xF3, (byte) 0xCF, (byte) 0x3F };
			index = (y * bytesPerLine) + (x >> 2);
			int offset = 3 - (x % 4);
			while (n > 0) {
				theByte = pixels[i] & 0x3;
				data[index] = (byte) ((data[index] & masks[offset]) | (theByte << (offset * 2)));
				i++;
				n--;
				srcX++;
				if (srcX >= width) {
					srcY++;
					index = srcY * bytesPerLine;
					offset = 0;
					srcX = 0;
				} else {
					if (offset == 0) {
						index++;
						offset = 3;
					} else {
						offset--;
					}
				}
			}
			return;
		case 1:
			index = (y * bytesPerLine) + (x >> 3);
			while (n > 0) {
				mask = 1 << (7 - (srcX & 0x7));
				if ((pixels[i] & 0x1) == 1) {
					data[index] = (byte) ((data[index] & 0xFF) | mask);
				} else {
					data[index] = (byte) ((data[index] & 0xFF) & (mask ^ -1));
				}
				i++;
				n--;
				srcX++;
				if (srcX >= width) {
					srcY++;
					index = srcY * bytesPerLine;
					srcX = 0;
				} else {
					if (mask == 1) {
						index++;
					}
				}
			}
			return;
		}
		SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
	}