0

What I am trying to achieve is drawing a polygon programmatically based on mouse down events. Each mouse down event adds the current mouse point to the point collection of the polygon.

I also handle the mouse move events to add the current move point to the collection and remove the previous point.

Now I am able to achieve a polygon which is updated in real time.

What I want to do is to change the color of the line which joins the current move point and the first point (to complete the polygon).

Any help would be appreciated.

1
  • Can you provide some code where the actual rendering is happen for the polygon ? Commented Jul 18, 2013 at 5:27

1 Answer 1

1

You can't do it with a single Polyline. Instead you would have to use an additional Line control (or a second Polyline) to draw the "current" line with the moving end point with a different stroke. When moving has finished, you would add the end point to the point collection of the Polyline.

This solution would also avoid repeated adding and removal of the moving point in the Polyline point collection, which each time forces a redraw of the whole Polyline.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot for your help. Actually I was looking for a built in way but this too works for me. Thanks once again.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.