GDI + Graphics Drawing method
1. First, for drawing graphics, the namespace must first be imported: using System.Drawing.Drawing2D;
2. Then write the program in an event
First, the object of the graphics is instantiated;
Then it is an instanced pen (pen) or brush (brush);
Instantiating a pen mypen = new Pen (color (selection color), line thickness of the pen)
instance of the Brush
SolidBrush: Its instantiation only needs to specify the value of the Color property;
HatchBrush: Its instantiation needs to specify the graphics and colors that need to be drawn;
Linergradientbrush: is used to draw the gradient color map, need to pass in two points and two points of color;
3. Basic Graph Drawing algorithm
Line: Two points indicated on OK;
Rectangle: The coordinates of the incoming starting point and the height and width of the rectangle;
Ellipse: A fixed border method that specifies the coordinates of the upper-left corner of the border and the height and width of the border;
Arc: Still adopt the way that the frame is fixed, then use the starting angle and rotation angle to fix this arc;
Sector: the drawing of a sector is drawn with the direction of the center coordinate and then into the starting angle and rotation angle, which is somewhat similar to drawing arcs.
Polygon: The polygon is drawn in a way that determines the point, then all the points are concentrated in an array after the instantiation point, and the array is passed to the DrawPolygon method, and the polygon is drawn.
GDI + graphics drawing methods in C #