TouchPoint touchPoint = e.GetTouchPoint(mywin); p2 = touchPoint.Position; RectangleGeometry rec = new RectangleGeometry(); rec.Rect = new Rect(p1, p2); Path path = new Path(); path.Fill = Brushes.LemonChiffon; path.Stroke = Brushes.Black; path.StrokeThickness = 1; path.Data = rec; canvas1.Children.Add(path);