title: Can't set palette in bitmap
body: <p>I have been writing a PCX decoder and, so far, the PCX image itself parses fine, but I can't work out how to set the palette of a bitmap.</p>
  
  <p>I have created a bitmap like so:</p>
  
  <pre><code>Bitmap bmp = new Bitmap(width,
                          height,
                          stride2,
                          System.Drawing.Imaging.PixelFormat.Format8bppIndexed,
                          pixels);
  </code></pre>
  
  <p>But I can't seem to set the palette using the following method:</p>
  
  <pre><code>for (int i = 0; i &lt; 256; i += 3)
  {
      Color b = new Color();
      b = Color.FromArgb(palette[i], palette[i + 1], palette[i + 2]);
      bmp.Palette.Entries.SetValue(b, i);
  }
  </code></pre>
  
  <p>In this example, I have read through each byte in the palette of the pcx file and stored them in palette[]. from there, I have used this to set the entries in the palette of the bitmap. How do I set the colours?</p>