i am trying to get image from fingerprint scanner through c# application, but when transferring through UART, to quicken speed, only the upper 4 bits of the pixel is transferred (that is 16 grey degrees). And two adjacent pixels of the same row will form a byte before the transferring.
So converting that byte stream back to image i am using following code:-
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
pictureBox2.Image = returnImage;
But it is giving me error as
"Parameter not valid"
for :
Image returnImage = Image.FromStream(ms);
I am getting around 500 bytes of data. Could any one please provide any solution so that image when uploaded to PC, the 16-grey-degree image can be extended to 256-grey-degree format i.e. 8-bit BMP format.