Point Arrangement and Orientation
-
Many overloads of System.Drawing.Graphics use Point array as a parameter. But I've found a puzzling problem with the Point array. The order in which the points are stored in the array creates different shape than intended. I used System.Drawing.Graphics.FillPolygon using four points and two different results came out depending on the order of points(http://img509.imageshack.us/img509/2944/boxch5.jpg[^]). Yes, i could have used the FillRectangle, but i will use figures with more than 4 sides. I want to know if there is a way to arrange the points so that they have a counterclockwise or clockwise rotation.
-
Many overloads of System.Drawing.Graphics use Point array as a parameter. But I've found a puzzling problem with the Point array. The order in which the points are stored in the array creates different shape than intended. I used System.Drawing.Graphics.FillPolygon using four points and two different results came out depending on the order of points(http://img509.imageshack.us/img509/2944/boxch5.jpg[^]). Yes, i could have used the FillRectangle, but i will use figures with more than 4 sides. I want to know if there is a way to arrange the points so that they have a counterclockwise or clockwise rotation.
gigahertz205 wrote:
The order in which the points are stored in the array creates different shape than intended.
The result is exactly as expected. The FillPolygon doesn't do any calculations to find out which points are nearest to each other, it just draws a polygon using the points in the exact order that you specified.
gigahertz205 wrote:
I want to know if there is a way to arrange the points so that they have a counterclockwise or clockwise rotation.
Where do you get the points from, and what's the reason that they are not in that order already?
Despite everything, the person most likely to be fooling you next is yourself.
-
gigahertz205 wrote:
The order in which the points are stored in the array creates different shape than intended.
The result is exactly as expected. The FillPolygon doesn't do any calculations to find out which points are nearest to each other, it just draws a polygon using the points in the exact order that you specified.
gigahertz205 wrote:
I want to know if there is a way to arrange the points so that they have a counterclockwise or clockwise rotation.
Where do you get the points from, and what's the reason that they are not in that order already?
Despite everything, the person most likely to be fooling you next is yourself.
Well if you look at my previous posts, you will get a basic idea of what im trying to do. I want to divide up an image using arbitrarily oriented lines, and use points of the polygons to edit the contents within that region. Basically, i use two points to create line segments, whose points will be added to Point arrays of that region. But then again, i as i create the line segments, i have no way to enforce which points to add first.