I have a cam that is returning 10 bits pixels. I get an array that is double the size of the picture because it is using two 8 bit bytes to make one 10 bit integer.
so one pixel = two bytes .
So I have a working convert for that part. however, I need to display an array of integers in to a bitmap.
how do I do that ?
public static Bitmap ByteToImage(int[] blob)
{
MemoryStream mStream = new MemoryStream();
int[] pData = blob;
mStream.Write(pData, 0, Convert.ToInt32(pData.Length));
Bitmap bm = new Bitmap(mStream, false);
mStream.Dispose();
return bm;
}
I am getting an error on this one. but I really am not sure how to do this.