C#gdi Drawing
1. Drawing steps
1.1 Creating a Graphics class
The OnPaint() method parameter of the 1.1.1 control class PaintEventArgs gets the Graphcis object.
1.1.2 The creatgraphics() method in the form class or control to get the Graphics object.
1.1.3 produces a graphics object from a Bitmap object (Bitmap).
Common methods for 1.1.4Graphics classes:
Dispos: Releasing all resources used by the graphics
DrawEllipse: Drawing an ellipse
DrawArc: Drawing arcs
DrawLine: Drawing Lines
DrawPolygon: Drawing polygons
DrawRectangle: Drawing rectangles
Drawpie: Drawing an ellipse
Drawcurse: Drawing Curves
FillEllipse: Fills the interior of an ellipse
FillRegion: Fills the interior of region
ScaleTransform: The specified zoom operation is applied with the graphics
TranslateTransform: Panning changes the origin of the coordinate system
1.2 Creating Brushes Pen Class Object
Pen p = new Pen (color.red);
1.3 Creating a Brush class object
SolidBrush B = new SolidBrush (color.white);
The brush class is used to populate graphics and is an abstract class, so it cannot be instantiated directly. Therefore, you need to set the style of the brush through derived classes.
ImageBrush: Drawing Area
Linegradientbrush: Linear gradient drawing Area
RadialGradientBrush: Radial gradient drawing area, focus defines the beginning of the gradient, the ellipse defines the end of the gradient
SolidColorBrush: Monochrome Paint Area
VideoBrush: Video content drawing area
1.4 Creating a Font class
Font f = new Font ("script", 24,fontstyle.italic);
C#gdi Drawing