Third experiment interactively draw a polygon

This experiment ······ can not find online. Kong German experiment code downloaded password, brute force is no hope, our only write.

The second experiment and are closely linked.

Experimental realization of goals: Click a point on the screen, release the mouse movement, the line will be extended with the mouse, click again will form a new point, forming a line between two points, then the new line continues to run with the mouse.

When the mouse after the starting point, the starting point of the straight line is automatically connected to form a closed polygon, and the filling color is completed.

The relative second experiment, we want to achieve dynamic display line (rubber band rendering) and filled polygons. Wherein filled polygons uses a double buffering mechanism, avoid excessive drawing (instantaneous color).

 

 

 

To be continued

Guess you like

Origin www.cnblogs.com/amtop/p/10960875.html