WPF simulates QQ logon background animation and wpf logon background animation
Introduction
The reason is simple simulation, because I don't know how the QQ login background animation is implemented. Here, it is simplified through some methods and achieved a similar effect.
General idea
First, we regard the background as the array distance of a 4-row and 8-column point. The Y axis is 70. connect points to a triangle. it is displayed in the Blue Circle of the outer layer. Only the section in the green box of the middle layer is displayed. in this way, the points in the outermost layer do not need to be moved, and only the points in the green box can be randomly moved. then, the color and time of the triangle Fill will be randomly colored. After the animation is completed, the color animation will be re-executed to loop.
In terms of implementation, you should note that each vertex corresponds to multiple triangles. When a triangle is generated, you must register it to the vertex and record the index of the triangle vertex set where the vertex is located. when the points change, traverse the registered triangle set, corresponding points in the triangle. also changes.
See the code for specific implementation.
Source code download: QQ ghost page background animation. Zip