GHI.Processor.StartupLogo.Save always throws System.ArgumentException

Disabling and saving startupText on my FEZ Raptor (G400S with T43, VS2012, NETMF 4.3 SDK 2014 R2) works fine, but when I try to enable the GHI.Processor.StartupLogo by:


Display.ShowBootupMessages = false;
// save startup display configuration & reboot device, if necessary
if (Display.Save()) // detect if ShowBootupMessages-property has been changed
{
  Debug.Print("Display configuration had to be saved -> Resetted device");
  Microsoft.SPOT.Hardware.PowerState.RebootDevice(false);          
}
else
{
  Debug.Print("Display configuration had NOT to be saved");
}
Bitmap startupLogo = new Bitmap(Resources.GetBytes(Resources.BinaryResources.logo), Bitmap.BitmapImageType.Bmp);
StartupLogo.Image = startupLogo;
StartupLogo.Enabled = true;               
if (StartupLogo.Save()) // save startup logo & reboot device, if necessary
  Microsoft.SPOT.Hardware.PowerState.RebootDevice(false);  

calling the StartupLogo.Save-method always fails the following exception is thrown:

#### Exception System.ArgumentException - 0xfd000000 (1) ####
#### Message: 
#### GHI.Processor.StartupLogo::NativeSave [IP: 0000] ####
#### GHI.Processor.StartupLogo::Save [IP: 0028] ####
#### PWMSGadget.Program::ProgramStarted [IP: 017c] ####
#### PWMSGadget.Program::Main [IP: 0010] ####

A first chance exception of type ‘System.ArgumentException’ occurred in GHI.Hardware.dll

Assigning the 180x180 pixel bitmap logo to StartupLogo.Image (taking into account https://netmf.codeplex.com/workitem/2121) executes without exception. I succeeded getting the logo as bmp, jpg and gif resource (each with 8 and 24bit color depth, 180x180 pixels), but in all cases the above exception is thrown after calling StartupLogo.Save().

Has anyone already been successful in showing the GHI.Processor.StartupLogo with VS2012 and NETMF 4.3 R2 SDK or newer?

@ Harald - You must also set the X and Y coordinates of the logo since they may default to an invalid number.


StartupLogo.X = 0;
StartupLogo.Y = 0;

1 Like

@ John - That’s it! Now it works. Many thanks for your quick reply.

Where is the startuplogo stuff documented?

https://www.ghielectronics.com/downloads/man/Library_Documentation_v4.3/ or direct link https://www.ghielectronics.com/downloads/man/Library_Documentation_v4.3/html/c8fa2898-0b42-2d47-dd82-210bba20b800.htm