I am working on an application which has small TextBlocks. When trying to get TapEvents on these I objects I noticed that I was sometimes getting adjacent objects instead of the one that I was pressing with a stylus.
I used the GlideCalibration class to calibrate the touch screen. I basically used the sample program with the save parameter set to true.
I then wrote a program to display the touch accuracy.
I ran the callibration routine many times, each time with less then good results.
I even erased the board using MFDeploy between calibrations.
I can see that is a large button was used, and the press was not near the edges of the button, the accuracy I was seeing would be fine.
I may be expecting more than possible from the resistive screens. The accuracy I was seeing was fine for finger selection.
I would be interested in knowing what kind of accuracy others were obtaining using the program below to verify.
using System;using System.Threading;
using Microsoft.SPOT;
using GHIElectronics.NETMF.Glide;
using GHIElectronics.NETMF.Glide.Display;
using GHIElectronics.NETMF.Glide.UI;
using GHIElectronics.NETMF.Glide.Geom;
using GHIElectronics.NETMF.Hardware;
namespace SpiderScreenTouchTest
{
public class Program
{
private static Point lastPoint;
private static WindowEx window;
public static void Main()
{
// Load the window
window = new WindowEx("window", 320, 240);
// Activate touch
GlideTouch.Initialize();
Glide.MainWindow = window;
Thread.Sleep(Timeout.Infinite);
}
private class WindowEx : Window
{
public WindowEx(String name, int width, int height)
: base(name, width, height)
{
}
public override TouchEventArgs OnTouchDown(TouchEventArgs e)
{
Debug.Print("X: " + e.Point.X.ToString() + " Y: " + e.Point.Y.ToString());
window.Graphics.DrawLine(Colors.White, 1, e.Point.X - 2, e.Point.Y, e.Point.X + 2, e.Point.Y);
window.Graphics.DrawLine(Colors.White, 1, e.Point.X, e.Point.Y - 2, e.Point.X, e.Point.Y + 2);
window.Graphics.Flush();
lastPoint = e.Point;
e.StopPropagation();
return e;
}
}
}
}