0

I created polygon for set of fixed points

Polygon myPolygon = new Polygon();

System.Windows.Point Point1 = new System.Windows.Point(50, 100);
System.Windows.Point Point2 = new System.Windows.Point(200, 100);
System.Windows.Point Point3 = new System.Windows.Point(200, 200);
System.Windows.Point Point4 = new System.Windows.Point(300, 30);
PointCollection polygonPoints = new PointCollection();
polygonPoints.Add(Point1);
polygonPoints.Add(Point2);
polygonPoints.Add(Point3);
polygonPoints.Add(Point4);

myPolygon.Points = polygonPoints; 
mygrid.Children.Add(myPolygon);

Is it possible to create polygon from dynamic points?

Nikolay Kostov
  • 16,433
  • 23
  • 85
  • 123
Thulasi
  • 23
  • 6
  • http://stackoverflow.com/questions/828905/polygon-enclosing-a-set-of-points – Murdock Mar 25 '14 at 09:40
  • 1
    What do you mean by "dynamic points"? If `new System.Windows.Point(x, y)` where `x` and `y` are calculated at runtime is a "dynamic point", then that's what you need. – Matthew Watson Mar 25 '14 at 09:45
  • In the interface i should able to deplace the points to change shape of polygone. – Thulasi Mar 25 '14 at 10:12

0 Answers0