title: How to convert GrayScale image to byte array?
body: <p>I have grayscale image and i want to see its byte[] is there anyway to do this ? </p>
  
  <p>Here i get grayscaleimage ; </p>
  
  <pre><code> private void OnImage(NGrayscaleImage nImage)
   {
   }
  </code></pre>
  
  <p>And i want to send it to this function ; </p>
  
  <pre><code> private void SendBiometricInfo(byte[] imageBuffer, int imageWidth, int imageHeight)
   {
   }
  </code></pre>
  
  <p>Is there anyway to do this ? If so could you help me to handle this issue ? </p>
  
  <p><strong>Here is what i tried ...</strong> </p>
  
  <pre><code>private void OnImage(NGrayscaleImage nImage)
  {
      OnImageByte(ImageToByte(nImage), nImage.Width, nImage.Height);               
      //However here it says there is an invalid arguments.
  }
  
  
  public static byte[] ImageToByte(Image img)
  {
      ImageConverter converter = new ImageConverter();
      return (byte[])converter.ConvertTo(img, typeof(byte[]));
  }
  
  void OnImageByte(byte[] imgBuffer, int width, int height)
  {
  }
  </code></pre>