How to draw a rectangle to include several points listed in it, and the rectangle just contains these points. Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiMultimedia/html/delphi_20060923191237297.html
Ladies and gentlemen, how to draw a rectangle to include all the points listed in it, and the rectangle just contains these points. The angle of the rectangle is determined by the edges of these points.
The x y coordinate value of the traversal point. Retrieve the leftmost value, top value, buttom value, and rightmost value of the vertex. Can you just draw it?
I thought so too, but this is used when all vertices form a triangle.AlgorithmThe problem may occur.
The minimum rectangle does not know how to prove it.
If it's just a rectangle with a horizontal or vertical line, you can use functions such as Min and Max.
It may be complicated to require a skewed rectangle ......
Find the ~~ of all vertices ~~ Minimum coordinates (take the smallest point of X and the smallest point of Y) and maximum coordinates ......
Use numerical solutions.