views:

210

answers:

1

I have the following PathPoints and PathTypes arrays (format: X, Y, Type):

-177.477900,  11021.670000, 1
-614.447200,  11091.820000, 3
-1039.798000, 10842.280000, 3
-1191.761000, 10426.620000, 3
-1591.569000, 10493.590000, 3
-1969.963000, 10223.770000, 3
-2036.929000, 9823.960000,  3
-2055.820000, 9711.180000,  3
-2048.098000, 9595.546000,  3
-2014.380000, 9486.278000,  3

Here is what this GraphicsPath physically looks like. The 2 Arcs are very distinguishable: alt text

I know that this GraphicsPath.PathData array was created by 2 AddArc commands. Stepping through the code in the debugger, I saw that the first 4 PathData values were added by the first AddArc command, and the remaining 6 points were added by the 2nd AddArc command.

By examining the raw pathpoints/pathtype arrays (without previously knowing that it was 2 AddArc commands so I would know that I have 2 start and end points), I would like to determine to start and end point of each arc.

I have tried several Bezier calculations to 'recreate' the points in the array, but am at a loss to determine how to determine the separate start and end points. It appears that GDI+ is combining the start/end point between the arcs (they are the same point and the arcs are connected), and I am losing the fact that one arc is ending and other one is starting.

Any ideas?

A: 

Take a look at the PathPointType Enum (System.Drawing.Drawing2D). Value Meaning 0 Start (path) 1 Line 3 Bezier/Bezier3 7 PathType Mask 16 Dash Mode 32 Path Marker 128 Close Subpath

TEN Ware
That is what the 3rd number in my list above (the PathPointType). The issue I have is that the is 2 Bezier/Bezier3 (PathPointType = 3) curves in the array above. I need to figure out how to determine where to divide the array. I know my adding the arc programatically that the '-1191.761000, 10426.620000, 3' value is the endpoint of the first arc and the start point of the second arc. However, I need to figure out how to determine that programmatically.
Tim Cochran