HP TouchSmart 9100 - Business PC Application Manual page 21

Resources for developing touch-friendly applications for hp business touch-enabled desktops
Hide thumbs Also See for TouchSmart 9100 - Business PC:
Table of Contents

Advertisement

#endregion
#region Constructors/Initialization
public Window1()
{
InitializeComponent();
// here's the first thing you need to do.
you want to set the tablet
// property to receive multi-touch data.
window loaded to ensure the handle is created.
this.Loaded += new RoutedEventHandler(
delegate(object sender, RoutedEventArgs args)
{
var source = new WindowInteropHelper(this);
SetProp(source.Handle,
IntPtr(0x01000000));
});
// then, simply subscribe to the stylus events like normal.
you'll get an event for each contact.
// so, when you move both fingers, you get a StylusMove event
for each individual finger
this.StylusDown += new
StylusDownEventHandler(Window1_StylusDown);
this.StylusMove += new StylusEventHandler(Window1_StylusMove);
this.StylusUp += new StylusEventHandler(Window1_StylusUp);
}
#endregion
#region Touch Events
void Window1_StylusDown(object sender, StylusDownEventArgs e)
{
Point p = e.GetPosition(this);
contact
// attribute an id with a touch point
if (Touch1ID == 0)
{
Touch1ID = e.StylusDevice.Id;
// move the rectangle to the given location
Touch1.SetValue(Canvas.LeftProperty, p.X - Touch1.Width /
2);
Touch1.SetValue(Canvas.TopProperty, p.Y - Touch1.Height /
2);
}
else if (Touch2ID == 0)
{
"MicrosoftTabletPenServiceProperty", new
upon window load,
You need to the
// get the location for this
21

Advertisement

Table of Contents
loading

This manual is also suitable for:

Touchsmart dx9000Touchsmart 9100

Table of Contents