title: How to create Bitmap from System.Window.media.PixelFormats.Gray16
body: <p>I am successfully drawn images from their raw pixel data.(only 8 bit images).
  here is the code for doing the same thing.</p>
  
  <pre><code>     PixelFormat format = PixelFormat.Format8bppIndexed;
       Bitmap bmp = new Bitmap(Img_Width, Img_Height, format);
       Rectangle rect = new Rectangle(0, 0, Img_Width, Img_Height);
       BitmapData bmpData = bmp.LockBits(rect, ImageLockMode.ReadWrite, format);
       Marshal.Copy(rawPixel, 0, bmpData.Scan0, rawPixel.Length);
       bmp.UnlockBits(bmpData);
  </code></pre>
  
  <p>Now as you all know PixelFormat.format16bppGrayscale is not supported by c# 2.0 GDI+.
  I googled and got 3.0/3.5 framework support this.
  So i installed both.
  The class which is support is System.windows.media.PixelFormats.
  PixelFormats.Gray16</p>
  
  <p>Now my problem is how to create a bitmap and get a image for display by passing this parameter.</p>
  
  <p>i got something BitmapSource class there but i am very new in C#3.0.</p>
  
  <p>Please help me.</p>