none
TouchPanelSetCalibration not updating calibration RRS feed

  • Question

  • Problem

    Our product is providing a wizard to calibrate the touch screen. A special requirement is that I need to verify every new calibration which is made by this wizard. The verification is quite simple tho. After the touch screen has been calibrated a new screen containing 4 touch targets (buttons) is shown, if the user is able to hit each target within a given time frame the calibration is considered successful. If time runs out, the calibration data in the registry shall be restored and the touch driver shall be restored without restarting.

    Approach

    1. Backup of HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\TOUCH\CalibrationData
    2. Show Windows CE built-in calibration UI using: TouchCalibrate()
    3. Show custom verification screen as described above.
    4. If verification failed restore registry and call TouchPanelSetCalibration(...` using old calibration data.

    When calling `TouchPanelSetCalibration(...)` I get the following output:
    Maximum Allowed Error 54:
    Calibration Results:
     Screen    =>    Mapped
    ( 240,  136) => ( 240,  130)
    (  96,   54) => (  93,   57)
    (  96,  218) => (  99,  218)
    ( 384,  218) => ( 381,  220)
    ( 384,   54) => ( 387,   55)
     Maximum error (square of Euclidean distance in screen units) = 36

    The registry is properly restored and considering the output I'm assuming the calibration data is also properly forwarded to the driver.

    But somehow the touch calibration is not restored without restarting the system.

    Do I need to signal this change somehow by sending a message or firing an event? Do I need to make any additional API calls? 
    ...Any help is appreciated

    Thanks.
     
    Tuesday, March 18, 2014 2:39 PM

Answers

  • The Touch Driver Entrypoint 'TouchPanelSetCalibration' must be called by GWES to get the calibration data updated. When called from a user application, the API would only update data held inside the application process.

    But there is an other approach to implement your touch calibration wizard.

    The Touch Calibration UI (calibrui) shown by 'TouchCalibrate()' can be customized. Basically, you'd need to replace the default confirmation screen with your own implementation.

    The instructions on how to clone the default CalibrUi can be found:
    For Windows CE 5.0 in MSDN under http://msdn.microsoft.com/en-us/library/aa452834.aspx
    For CE 6.0 and Compact 7: http://guruce.com/blogpost/cloning-calibrui-in-windows-ce-60


    MVP Windows Embedded

    • Marked as answer by xSambuca Thursday, March 20, 2014 10:45 AM
    Wednesday, March 19, 2014 10:41 PM