質問

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.

~Sambuca

役に立ちましたか?

解決

I also posted this question on MSDN forums. Here's the answer I got there:

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:

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top