When I read out the sw.bmp file from the sd card into an array, and then try to instantiate a Bitmap object, I get an exception.
public static void Main()
{
// Mount SD Card stuff
SDCard sd_card = new SDCard();
sd_card.Mount();
string rootDirectory = VolumeInfo.GetVolumes()[0].RootDirectory;
//sw.bmp
FileStream fileHandle = new FileStream(rootDirectory+@ "\sw.bmp", FileMode.Open, FileAccess.Read);
byte[] swImage = new byte[fileHandle.Length];
int readCount = fileHandle.Read(swImage, 0, swImage.Length);
fileHandle.Close();
sd_card.Unmount();
Bitmap bm = new Bitmap(swImage, Bitmap.BitmapImageType.Bmp);
bm.DrawImage(0,0, bm, 0,0,100,100);
bm.Flush();
Thread.Sleep(Timeout.Infinite);
}
Exception thrown at Bitmap bm = new Bitmap(swImage, Bitmap.BitmapImageType.Bmp);
The thread '<No Name>' (0x2) has exited with code 0 (0x0).
#### Exception System.NotSupportedException - CLR_E_NOT_SUPPORTED (1) ####
#### Message:
#### Microsoft.SPOT.Bitmap::.ctor [IP: 0000] ####
#### TestImageRotation.Program::Main [IP: 0078] ####
A first chance exception of type 'System.NotSupportedException' occurred in Microsoft.SPOT.Graphics.dll
An unhandled exception of type 'System.NotSupportedException' occurred in Microsoft.SPOT.Graphics.dll
Fez Cobra II (G120)
Latest 4.3 built from GHI
Thoughts? Its an actual bmp object