I’m trying to draw bitmaps to the Display N18 from a STM32F405RGT6 (I think that’s similar to the one on the FEZ Cerberus) running NetMF 4.2
When I try to follow the instructions for drawing a bitmap fragment to the N18 display at https://www.ghielectronics.com/docs/59/display-n18-module I’m not sure what bit depth to use. The instructions recommend using Paint, which saves bitmaps by default at 24 bit but later in the code the byte array size calculation (byte newRender = new byte[128 * 160 * 2] makes me think it should be 16bit. What is the bit depth the N18 expects?
When I run the sample code I get an error.
var tdata = Resources.GetBytes(Resources.BinaryResources.yes_no); var picture = new Bitmap(tdata, Bitmap.BitmapImageType.Bmp); var newRender = new byte[13*79*2]; Array.Copy(newRender, picture.GetBitmap(), newRender.Length); _display.DrawRaw(newRender, 13, 79, 50, 50);
The second line throws the error:
An unhandled exception of type ‘System.NotSupportedException’ occurred in Microsoft.SPOT.Graphics.dll
Why do I get this error and how should I fix it?