Touch position way off

I’m using the 7" LCD with the button example…set up the XML so it covers the full size, but to activate my LARGE button, the press must be pressed way to the side of the button…any thoughts?

Did you calibrate your touch screen?
In some cases in practice using calibration several times gives better accuracy.

My screen is plenty calibrated (I think)…using another program touching in the corner I get 796,469

When touching my button, I am off at least 1 inch from the outside of the button!!

Plese indicate how you can calibrate the screen, if needed.

Can you send an example that has 1 button that changes its message when pressed (PLEASE PRESS ME, NOW I’M PRESSED) & will gauranteed work on the 7" display? I’ve spent several hours with no luck at all.

I have tried several ideas, but no luck…any thoughts on what to try? I must press outsside of the button area to get a response.

I’d like to clarify it’s not a fact that your program uses calibration settings retrieved by another program and saved as a weak reference.
Just try to search you code for this:


If no result - it would be the reason of invalid touch positions.
There might be different reasons for your problem.

If you are using glide you should do calibration with glide. I don’t know if the glide has the possibility to initiate calibration at any moment… If it has you should do it.
Also you could try to erase your device with mfdeploy and recalibrate it.

Can you specifically show how to do this calibration (in glide)? Again, when I run the GHI LCD demo it show valid looking numbers.

I’m not sure what Glide uses.

Does anyone else use Glide with the 7" scrren?

Skip Glide or any other lib for now, can you draw to the screen? Get an image and move it around the screen or, best, draw 4 lines on the very edge of the screen to verify the whole display is running.

Next, load the display calibration example provided by Microsoft C:\Users\Gus Issa\Documents\Microsoft .NET Micro Framework 4.1\Samples

I tried the Microsoft cal routine…I guess its working, it just shows dots on the screen, no messages as to what it is doing…am I supposed to just touch the dots forever?

Is there something special you need to do to use it for 7" scren? I seeit uses SystemMetrics.ScreenWidth, but don’t know how/where that is automatically setup for 7" display.

how many cal points are there? It never seems to end or give an indication that cal is complete.

Putting text up on the screen seems to work properly.

have you tried this with a 7" screen?

Of course we tried it with 7" displays and works just fine.

You need to run the calibration window.

When I use the GHI touch demo (not Glide), it shows near perfect coordnates for the 7" screen, wherever it is pressed.

When I use the Glide button demo & the size 480x80 button is positioned at (0,0) you can touch the button or below the button & get a response. When the button is moved to 100,100 touching the button has no effect, but 1 inch below the button does activate it.

Is there a way to show the coordinates when a button is pressed?

Do you mean as part of the button program, or separately? I did run the cal demo, but it never ends.

here is what I am using:

//<Glide Version="1.0.3">
//<Window Name="window" Width="800" Height="480" BackColor="dc0090">
//<Button Name="btn" X="100" Y="100" Width="480" Height="80" Alpha="255" Text="RESUME Operation" Font="4" FontColor="000000" DisabledFontColor="808980" TintColor="000780" TintAmount="100"/>

using System.Threading;

using Microsoft.SPOT;

using GHIElectronics.NETMF.Glide;
using GHIElectronics.NETMF.Glide.Display;
using GHIElectronics.NETMF.Glide.UI;
using Microsoft.SPOT.Touch;
namespace Glide_Button
    public class Program
        // This will hold the main window.
        static Window window;
        public static void Main()
            // Load the window
            window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Window));

            // Activate touch

            // Initialize the window.

            string OriginalText="";


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


        static void InitWin(string OriginalText)
            // Get the Button
            Button btn = (Button)window.GetChildByName("btn");
            btn.Font = Resources.GetFont(Resources.FontResources.calibri48);

            // Listen for tap events
            btn.PressEvent +=  btn_PressIt;
            btn.ReleaseEvent += btn_Releaseit;

         static void btn_Releaseit(object sender)
            Button btn = (Button)window.GetChildByName("btn");
            btn.Text = "RELEASE";
            // window.Render();

            btn.Text = "RESUME Operation";
         //   window.Render();

        // Handle tap events
         static void btn_PressIt(object sender)
            Debug.Print("I can perform an action!");
            Button btn = (Button)window.GetChildByName("btn");
          //  OriginalText = btn.Text;

            btn.Text = "Now Resuming";
           // window.Render();


did anyone see a problem with this example?..the cal is way off!
I am going to give GHI a call to see if they have a fix in the works

Most companies around the world have today off, including GHI :slight_smile:

Try adding your button to this example code:

and change this

calWindow = new CalibrationWindow(false, false);

to this

calWindow = new CalibrationWindow(true, true);

When you run the example first do calibration, then try to touch your button. If you can’t touch the button to open calibration, adjust the code to start with the calibration window inside Main() like this

Glide.MainWindow = calWindow;

If you run into out of memory issues you’ll need to add code for a larger custom heap to run on the 7".