BrightIdeasSoftware.HighlightTextRenderer.GetRoundedRect C# (CSharp) Метод

GetRoundedRect() защищенный Метод

Return a GraphicPath that is a round cornered rectangle
If I could rely on people using C# 3.0+, this should be an extension method of GraphicsPath.
protected GetRoundedRect ( RectangleF rect, float diameter ) : GraphicsPath
rect System.Drawing.RectangleF The rectangle
diameter float The diameter of the corners
Результат System.Drawing.Drawing2D.GraphicsPath
        protected GraphicsPath GetRoundedRect(RectangleF rect, float diameter)
        {
            GraphicsPath path = new GraphicsPath();

            if (diameter > 0) {
                RectangleF arc = new RectangleF(rect.X, rect.Y, diameter, diameter);
                path.AddArc(arc, 180, 90);
                arc.X = rect.Right - diameter;
                path.AddArc(arc, 270, 90);
                arc.Y = rect.Bottom - diameter;
                path.AddArc(arc, 0, 90);
                arc.X = rect.Left;
                path.AddArc(arc, 90, 90);
                path.CloseFigure();
            } else {
                path.AddRectangle(rect);
            }

            return path;
        }

Same methods

HighlightTextRenderer::GetRoundedRect ( float x, float y, float width, float height, float diameter ) : GraphicsPath