Main Site Documentation

Project - Revised T35 LCD and SDCard. Create bitmaps and save display screens to SDCard


#1

Revised T35 LCD and SDCard. Create bitmaps and save display screens to SDCard

This code is a update to some old code I posted (I will be deleting it because at the time I did not know how to upload a full application). Maybe I coulden’t at the time?

The code is a full project made with C# Express 2010.
The code was run using the latest firmware 4.2.9.0. There is nothing special about the code and it is provided to show read/write of bitmaps to a SD Card and the T35 LCD display.

The sample code shows and saves three different screens of bitmap data. The three screens are cycled using a button press. The screens are mostly drawn text and other other graphics. There is also a demo of write/read of plain text. The text code is from the TINYCLR WIKI, SD Card Module, Reading/Writing files.

Let it be known that when I wrote the code I could not (for the life of me) read the bitmaps for the SD Card.
I could only read/write text, and write bitmaps. I could not read the bitmaps

The ‘FIX’ was provided by andre.m (GHI Form member).

For information…

I was using the following line (my original code). It did not work. Exception File Not Found.

bitmap = storage.LoadBitmap(pathFileName, Bitmap.BitmapImageType.Bmp);

The next line of code from andre.m saved the day!

bitmap = new Bitmap(File.ReadAllBytes(pathFileName), Bitmap.BitmapImageType.Bmp);

As a side note:
If you have issues with any SD Card media try the ‘official’ formatter found at
https://www.sdcard.org/downloads/formatter_4/eula_windows/
(I have never had a problem using Microsofts formatter)

Have fun!