Glide on FEZ cobra doesn't fit whole 4,3 inch screen

Hello,

I am trying out glide on my fez cobra, but my windows doesn’t fill the whole screen…

My window


<Glide Version="1.0.0">
  <Window Name="window2" Width="480" Height="272" BackColor="E6E6E6">
    <TextBlock Name="label" X="0" Y="0" Width="480" Height="32" Alpha="255" Text="Energy Logger - Main" TextAlign="Center" TextVerticalAlign="Middle" Font="4" FontColor="0"/>
    <Button Name="btnStart" X="100" Y="50" Width="80" Height="32" Alpha="255" Text="Start" Font="4" FontColor="000000" DisabledFontColor="808080" TintColor="000000" TintAmount="0"/>
    <Button Name="btnStop" X="300" Y="50" Width="80" Height="32" Alpha="255" Text="Stop" Font="4" FontColor="000000" DisabledFontColor="808080" TintColor="000000" TintAmount="0"/>
    <Button Name="btnManual" X="200" Y="94" Width="80" Height="32" Alpha="255" Text="Manual" Font="4" FontColor="000000" DisabledFontColor="808080" TintColor="000000" TintAmount="0"/>
    <Button Name="btnAuto" X="200" Y="140" Width="80" Height="32" Alpha="255" Text="Auto" Font="4" FontColor="000000" DisabledFontColor="808080" TintColor="000000" TintAmount="0"/>
    <Button Name="btnValues" X="180" Y="186" Width="120" Height="32" Alpha="255" Text="Current Values" Font="4" FontColor="000000" DisabledFontColor="808080" TintColor="000000" TintAmount="0"/>
  </Window>
</Glide>


static Window mainWindow = new Window();
        static Window manualWindow = new Window();
        static Window autoWindow = new Window();
        static Window valueWindow = new Window();
        static Window currentWindow = new Window();

        public static void Main()
        {
            // Load the windows
            mainWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Window1));
            manualWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Window2));
            autoWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Window3));
            valueWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Window4));
            mainWindow.Width = 480;
            mainWindow.Height = 272;
            //Debug.Print(FEZ_System.
            // Activate touch
            GlideTouch.Initialize();

            // Initialize the windows.
            // Since all windows are identical we can reuse the same function.
            InitWin(mainWindow);
            InitWin(manualWindow);
            InitWin(autoWindow);
            InitWin(valueWindow);

            // Assigning a window to MainWindow flushes it to the screen.
            // This also starts event handling on the window.
            Glide.MainWindow = mainWindow;

            Thread.Sleep(-1);
        }

Can someone help me?

Welcome to the forum!

I suspect you have to configure the LCD first:

http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation/html/cf4f6ce9-920d-5b02-8b85-b9d756441929.htm

Explained in the brochure:

http://www.ghielectronics.com/downloads/FEZ/Cobra/Broch_FEZ_4_3inTFTDisplayKit.pdf

Just added the following code and it works:


static void SetLCDConfigurations()
        {
            Configuration.LCD.Configurations lcdConfig = new Configuration.LCD.Configurations();
            lcdConfig.Width = 480;
            lcdConfig.Height = 272;

            // Only use if needed, see documentation.
            lcdConfig.PriorityEnable = false;

            lcdConfig.OutputEnableIsFixed = true;
            lcdConfig.OutputEnablePolarity = true;
            lcdConfig.HorizontalSyncPolarity = false;
            lcdConfig.VerticalSyncPolarity = false;
            lcdConfig.PixelPolarity = false;
            lcdConfig.HorizontalSyncPulseWidth = 41;
            lcdConfig.HorizontalBackPorch = 2;
            lcdConfig.HorizontalFrontPorch = 2;
            lcdConfig.VerticalSyncPulseWidth = 10;
            lcdConfig.VerticalBackPorch = 2;
            lcdConfig.VerticalFrontPorch = 2;

            // NOTE: This is used for EMX
            lcdConfig.PixelClockDivider = 8;

            // Set config
            if (Configuration.LCD.Set(lcdConfig))
            {
                // New settings were saved, must reboot
                Microsoft.SPOT.Hardware.PowerState.RebootDevice(false);
            }
        }

and it works but the touch isn’t verry accurate… Buttons aren’t respounding…

You need to configure touch for the new resolution. Pyxis 2 has code for this. Check it out on pyxis2.codeplex.com and you can just copy out the section of code you need. There’s also a static config somewhere on the forum.

Good job! Now you need calibration code. Explained in the same brochure. :wink:

You also have to calibrate your screen. Check the Glide library documentation for touch calibration.

:slight_smile: :slight_smile: :slight_smile: :slight_smile:

Three answer within a minute and they are not conflicting.

Man, we are good! ;D

That is it, I quit! You guys took my job!

Added the following but it doesn’t get better…


            CalibrationSettings Calibration = new CalibrationSettings();
            const int CAL_POINTS = 5;
            Calibration.SX = new short[CAL_POINTS] { 240, 48, 48, 432, 432 };
            Calibration.SY = new short[CAL_POINTS] { 136, 26, 246, 246, 26 };
            Calibration.CX = new short[CAL_POINTS] { 478, 189, 169, 781, 790 };
            Calibration.CY = new short[CAL_POINTS] { 481, 238, 741, 767, 231 };

Use the Calibration Window.

http://www.ghielectronics.com/downloads/Glide/Library%20V%201.0.0/html/90770305-3144-ec5b-d0f4-4593bcd76b52.htm

Works like a charm!

Thanks!

does this also works for ChipworkX Josh?

Glide runs on all NETMF devices and with any display size. It even runs on the emulator!

Gus, i know that it runs even in an emulator! what i’m talking about is the window calibration. since my issue is, it doesn’t fit whole on my ChipworkX LCD. It fits in the emulator, but not in my ChipworkX’s LCD, it’s smaller. That’s what i’m talking about.

then i think you should ask a separate question (with more detail in your post) and not confuse subjects. The original post was about making the screen area bigger on Cobra (EMX) and now you want to know “does this also work for ChipworkX” but really it’s about getting the screen res to work on ChipworkX.

my post was for Josh, who gives the link about the calibration. so i guess, it’s not confusing on what i’m referring to. :slight_smile:

thats your view; everyone else here seems to be confused by what you were asking ???