title: Setting pixel color of BMP/JPG file
body: <p>I'm trying to set a color of given pixel of the image.
  Here is the code snippet</p>
  
  <pre><code>        Bitmap myBitmap = new Bitmap(@"c:\file.bmp");
  
          for (int Xcount = 0; Xcount &lt; myBitmap.Width; Xcount++)
          {
              for (int Ycount = 0; Ycount &lt; myBitmap.Height; Ycount++)
              {
                  myBitmap.SetPixel(Xcount, Ycount, Color.Black);
              }
          }
  </code></pre>
  
  <p>Every time I get the following exception:</p>
  
  <blockquote>
    <p>Unhandled Exception: System.InvalidOperationException: SetPixel is not
    supported  for images with indexed pixel formats.</p>
  </blockquote>
  
  <p>The exception is thrown both for <code>bmp</code> and <code>jpg</code> files.</p>