I'm using a Bitmap that has a palette of 256 colors (256 bytes).
I'm taking the Bitmap data by:
System.Drawing.Imaging.BitmapData refData = myBitmap.LockBits(new
Rectangle(0, 0, bmp.Width, bmp.Height),
System.Drawing.Imaging.ImageLockMode.WriteOnly, bmp.PixelFormat);
byte* buff = refData.Scan0.ToPointer();
And on this buff I'm iterating to set its data.
The problem is that at some point of the iteration I'm getting the following
error:
"An unhandled exception of type 'System.AccessViolationException' occurred
in 1000Gates.exe
Additional information: Attempted to read or write protected memory. This is
often an indication that other memory is corrupt."
I'm suspecting that I'm overwriting the palette data of the bitmap.
Does my suspicion is correct?
How should I correct this failure and successfully iterate through the whole
bitmap data.
--
Thanks
Sharon