ATMLCommonLibrary.controls.awb.AWBGraphicsPath.GetRoundPath C# (CSharp) Метод

GetRoundPath() публичный статический Метод

public static GetRoundPath ( Rectangle r, int depth ) : GraphicsPath
r System.Drawing.Rectangle
depth int
Результат System.Drawing.Drawing2D.GraphicsPath
        public static GraphicsPath GetRoundPath(Rectangle r, int depth)
        {
            GraphicsPath graphPath = new GraphicsPath();

            graphPath.AddArc(r.X, r.Y, depth, depth, 180, 90);
            graphPath.AddArc(r.X + r.Width - depth, r.Y, depth, depth, 270, 90);
            graphPath.AddArc(r.X + r.Width - depth, r.Y + r.Height - depth, depth, depth, 0, 90);
            graphPath.AddArc(r.X, r.Y + r.Height - depth, depth, depth, 90, 90);
            graphPath.AddLine(r.X, r.Y + r.Height - depth, r.X, r.Y + depth / 2);

            return graphPath;
        }

Usage Example

Пример #1
0
        private void drawClickStateBackground(System.Windows.Forms.PaintEventArgs e,
                                              LinearGradientMode mode,
                                              int tmpSoundCornerRadius,
                                              int tmpShadowOffSet
                                              )
        {
            Pen          pen       = new Pen(BackColor);
            Rectangle    newRect   = new Rectangle(ClientRectangle.X + tmpShadowOffSet / 2, ClientRectangle.Y + tmpShadowOffSet / 2, ClientRectangle.Width - tmpShadowOffSet, ClientRectangle.Height - tmpShadowOffSet);
            GraphicsPath graphPath = AWBGraphicsPath.GetRoundPath(newRect, tmpSoundCornerRadius);

            e.Graphics.DrawRectangle(pen, newRect);
            drawBackground(e, _HoverBorderColor, _HoverColorA, _HoverColorB, ref newRect, graphPath);
            pen.Dispose();
        }
All Usage Examples Of ATMLCommonLibrary.controls.awb.AWBGraphicsPath::GetRoundPath
AWBGraphicsPath