Drawing circles with System.Drawing

后端 未结 8 1078
醉酒成梦
醉酒成梦 2021-01-03 22:56

I have this code that draws a Rectangle ( Im trying to remake the MS Paint )

 case \"Rectangle\":
               if (tempDraw != null)
                {
             


        
8条回答
  •  时光说笑
    2021-01-03 23:22

    You should use DrawEllipse:

    //
    // Summary:
    //     Draws an ellipse defined by a bounding rectangle specified by coordinates
    //     for the upper-left corner of the rectangle, a height, and a width.
    //
    // Parameters:
    //   pen:
    //     System.Drawing.Pen that determines the color, width,
    //      and style of the ellipse.
    //
    //   x:
    //     The x-coordinate of the upper-left corner of the bounding rectangle that
    //     defines the ellipse.
    //
    //   y:
    //     The y-coordinate of the upper-left corner of the bounding rectangle that
    //     defines the ellipse.
    //
    //   width:
    //     Width of the bounding rectangle that defines the ellipse.
    //
    //   height:
    //     Height of the bounding rectangle that defines the ellipse.
    //
    // Exceptions:
    //   System.ArgumentNullException:
    //     pen is null.
    public void DrawEllipse(Pen pen, int x, int y, int width, int height);
    

提交回复
热议问题