I have a WPF project which recognizes different inputs (e.g. finger, mouse, tagged objects) in the touch down method, I have an IF statement that recognizes if a tag is recognized and displays the data for the series and the value of the tag placed, then stores the data in the variable string type and displays it in the content of a label, the else recognizes if the touch is with a finger, and does the same thing.
However what I'm having trouble to achieve is being able to recognize the position in which a tag or finger is at the touch down poistion. I believe that a Point is needed to get the X&Y position of the touch but having tried multiple times with different things I cannot find a solution as to what parameters are needed.
The method
void SurfaceWindow1_TouchDown(object sender, TouchEventArgs e)
{
TouchDevice c = e.TouchDevice;
//by default it is a blob
string type = "Blob";
Point p = c.GetPosition();
if (c.GetIsTagRecognized() == true)
{
type = "Tag";
type += (" Series: " + c.GetTagData().Series.ToString("X", CultureInfo.InvariantCulture));
type += (" Value: " + c.GetTagData().Value.ToString("X", CultureInfo.InvariantCulture));
// type += (" Position: " //something here);
}
else if (c.GetIsFingerRecognized())
{
type = "Finger";
}
//display the type of item in a label
InfoLabel.Content = type;
}
The errors received
Error 1: 'Point' is an ambiguous reference between 'System.Windows.Point' and 'System.Drawing.Point'
Error 2: No overload for method 'GetPosition' takes 0 arguments
TouchPoint p = e.GetTouchPoint(sender as IInputElement);? - dkozl