The following is a C # in the control of the border angle to the arc of the implementation code is introduced, need friends can refer to the following
copy code code as follows:
private void Draw (Graphics Graphics, control control)
{
float X = float. Parse (Control. Width.tostring ())-1;
float Y = float. Parse (Control. Height.tostring ())-1;
pointf[] Pointfs = {
New PointF (2, 0),
New PointF (X-2, 0),
New PointF (X-1, 1),
New PointF (X, 2),
New PointF (X, Y-2),
New PointF (X-1, Y-1),
New PointF (X-2, Y),
New PointF (2, Y),
New PointF (1, Y-1),
New PointF (0, Y-2),
New PointF (0, 2),
New PointF (1, 1)
};
GraphicsPath path = new GraphicsPath ();
Path. AddLines (POINTFS);
Pen pen = new Pen (Color.FromArgb (Color.Blue), 1);
Pen. DashStyle = Dashstyle.solid;
Graphics. DrawPath (pen, path);
}
First, you register the control with an event: the name of the control. paint+= the event name, and then the above function for reference, such as: Draw (E.graphics, This.control);