Running the following code doesn’t seem to work.
Bitmap bmp = new Bitmap(10, 10); byte outputFile = new byte[bmp.Width * bmp.Height * 4 + 54]; //changed to 4 from 3 to fit rawBits byte rawBits = bmp.GetBitmap(); //This results in a array of length 400 not 300 as expected. Util.BitmapToBMPFile(rawBits, bmp.Width, bmp.Height, outputFile);
Firstly the GetBitmap() method returns a array of 4 * width * height rather than 3 as seems to be required by BitmapToBMPFile. I have tried with both 3 and 4.
Whatever I do I get this error:-
Exception System.NotSupportedException - CLR_E_NOT_SUPPORTED (1)
Am I doing something wrong? I have included GHI.Premium.System in the references and am using 188.8.131.52