c# - How to convert GrayScale image to byte array? -


I have a grayscale image and I want to see its byte [] is it anyway to do this?

Here I am getting grayscale;

  Private zero (NGrayscaleImage nImage) {}  

and I want to send it to this function;

  Private Zero SendBiometricInfo (Byte [imageBuffer, int imageWidth, int imageHyight] {}  

Is there anyway to do this? If you can help me handle this issue?

Here's what I have tried ...

  Private Zero Satisfaction (NGRScale Image Niges) {On ImageBite (ImageToit), Nijes Width , Nijes height); // However here it says that there is an invalid argument. } Public static byte [] ImageToibet (image image) {image converter converter = new image controller (); Return (Byte []) Converter Convert (IMG, typef (byte []); } Zero OnImageByte (byte [imgBuffer, integer width, integer height] {}  

If you can save your image as a JPG, then it is possible that you get from your NGrayscaleImage so that you can try saving it in the storage stream

  Byte [] imageToByteArray (System.Drawing.Image image) {(MemoryStream ms = new MemoryStream ()) {image.Save (ms, System.Drawing.Imaging.ImageFormat.Jpeg); Return to MS. ToArray (); }}  

Hope it helps.


Comments