GD Polygons and Custom Coordinates
I have a page that's written in jQuery and PHP. It's for censoring vehicle registration plates. What it allows you to do is upload an image, place 4 markers over your number plate and it will draw a filled polygon box over it for you.
The system works fine in rendering the polygon, except for one thing. For the polygon to actually form a solid shape you have to place the markers starting from the top left and working your way round clockwise as this is how it draws the polygon. If you do the top 2 from the left, then go back to the left side for the bottom you get 2 triangles where the lines cross over; obviously not creating a solid polygon box.
There are 8 values in an array thats sent into the image function. It takes each 2 numbers out of the array to create 4 marker point coordinates on the image. What I need to do is figure out how to make sure they are sent in the correct order to make the polygon and so the user could place them anywhere, it would still know which was top left, which was top right etc.
Any ideas? I know my array is 8 figures, however I could if it makes things easier change it so there is 4 arrays within 1 big array; although not sure if that would help matters.
Hope that makes sense, if not I can explain better with some pictures.