RGB[] rgbs = new RGB[] { new RGB(0,0,0), new RGB(0x80,0,0), new RGB(0,0x80,0), new RGB(0x80,0x80,0), new RGB(0,0,0x80), new RGB(0x80,0,0x80), new RGB(0,0x80,0x80), new RGB(0xC0,0xC0,0xC0), new RGB(0x80,0x80,0x80), new RGB(0xFF,0,0), new RGB(0,0xFF,0), new RGB(0xFF,0xFF,0), new RGB(0,0,0xFF), new RGB(0xFF,0,0xFF), new RGB(0,0xFF,0xFF), new RGB(0xFF,0xFF,0xFF), }; ImageData src = new ImageData(compWidth, compHeight, 8, new PaletteData(rgbs), 4, component);
ImageData src = new ImageData(compWidth, compHeight, 8, new PaletteData(RGB16), 4, component);
void expandImageComponents() {	for (int iComp = 0; iComp < nComponents; iComp++) {		int[] frameComponent = frameComponents[componentIds[iComp]];		int hi = frameComponent[HI];		int vi = frameComponent[VI];		int upH = maxH / hi;		int upV = maxV / vi;		if ((upH * upV) > 1) {			byte[] component = imageComponents[iComp];			int compWidth = frameComponent[CW];			int compHeight = frameComponent[CH];			int upCompWidth = compWidth * upH;			int upCompHeight = compHeight * upV;			RGB[] rgbs = new RGB[] {				new RGB(0,0,0),				new RGB(0x80,0,0),				new RGB(0,0x80,0),				new RGB(0x80,0x80,0),				new RGB(0,0,0x80),				new RGB(0x80,0,0x80),				new RGB(0,0x80,0x80),				new RGB(0xC0,0xC0,0xC0),				new RGB(0x80,0x80,0x80),				new RGB(0xFF,0,0),				new RGB(0,0xFF,0),				new RGB(0xFF,0xFF,0),				new RGB(0,0,0xFF),				new RGB(0xFF,0,0xFF),				new RGB(0,0xFF,0xFF),				new RGB(0xFF,0xFF,0xFF),			};			ImageData src = new ImageData(compWidth, compHeight, 8, new PaletteData(rgbs), 4, component);			ImageData dest = src.scaledTo(upCompWidth, upCompHeight);			imageComponents[iComp] = dest.data;		}	}}