private void PaletteForm_Load(object sender, EventArgs e) { if (pImage == null) { return; } imPalette = pImage.getPalette(); int i, j, pos; for (i = 0; i < 16; i++) { for (j = 0; j < 16; j++) { leftUpperPos[i * 16 + j].X = 10 + (25 + 2) * i; leftUpperPos[i * 16 + j].Y = 10 + (25 + 2) * j; } } }