Draw a US Flag using C# and GDI+
2016-08-23
0 0 0
no vote
Other
Earn points
Translation maninwest@Codeforge By Jack J. H Xu@CodeProjectVisual C # has a powerful GDI + class library interface, which allows users to draw various graphic objects. Here's how to use c#and GDI + to create the American flag. The US flag has 50 stars and several rectangles. Background polygon is one of the most important objects for 2D or 3D graphics rendering or processing. Graphics.DrawPolygon Method draws a polygon defined by an array of point structures. Every two connected points in the array can specify an edge of the polygon. Here's how to create us flag objects. First, define the coordinates of the stars. As shown in the figure below. Suppose the central coordinates of the star are (XC, YC), R1 is the radius of the inner circle, and R is the radius of the outer circle. The angle is a = 72 degrees, ß = 36 degrees. From this graph, you can easily determine the coordinates of the point (& nbsp; 0-9) & nbsp;: first, implement the DrawSTAR method to draw a star polygon in the center position (& nbsp; (XC, YC), and use the size control parameter & nbsp; R. When adding a drawflag method, first draw seven red bars on the white rectangular background. Note that the scale of the flag is maintained with the following settings: float height = 10 * width / 19; use this method to draw a blue rectangle. Finally, we use the DrawSTAR method to place 5 on the blue rectangle
c#
Related Source Codes
No. 186: DX0110- Source code for community propert
0
0
no vote
No. 219: DX0149- Source code for community propert
0
0
no vote
Verification code identification
0
0
no vote
CSV data analysis tool
0
0
no vote
Source code of hospital medical record information
0
0
no vote
No comment