S
Stephen.Schoenberger
I am using the following code to get a monochrome bitmap image into a
byte[] form
Rectangle rec = new Rectangle(0, 0, bmpSource.Width,
bmpSource.Height);
BitmapData bmpSData = bmpSource.LockBits(rec,
ImageLockMode.ReadWrite, bmpSource.PixelFormat);
// Get the address of the first line.
IntPtr iptr = bmpSData.Scan0;
// Declare an array to hold the bytes of the bitmap.
int ibytes = bmpSource.Width * bmpSource.Height;
byte[] bValues = new byte[ibytes];
// Copy the values into the array.
Marshal.Copy(iptr, bValues, 0, ibytes); //just use this!
how is the information stored? Meaning if I "read" bValues from 0 to
(bmp.Width) would that get me the first line in bmpSource? And what
would be the most effective way to save this bValues back to a Bitmap?
Thanks
byte[] form
Rectangle rec = new Rectangle(0, 0, bmpSource.Width,
bmpSource.Height);
BitmapData bmpSData = bmpSource.LockBits(rec,
ImageLockMode.ReadWrite, bmpSource.PixelFormat);
// Get the address of the first line.
IntPtr iptr = bmpSData.Scan0;
// Declare an array to hold the bytes of the bitmap.
int ibytes = bmpSource.Width * bmpSource.Height;
byte[] bValues = new byte[ibytes];
// Copy the values into the array.
Marshal.Copy(iptr, bValues, 0, ibytes); //just use this!
how is the information stored? Meaning if I "read" bValues from 0 to
(bmp.Width) would that get me the first line in bmpSource? And what
would be the most effective way to save this bValues back to a Bitmap?
Thanks