ATMLCommonLibrary.controls.awb.AWBButton.drawBackground C# (CSharp) Method

drawBackground() private method

private drawBackground ( System e, Color borderColor, Color colorA, Color colorB, Rectangle &rect, GraphicsPath graphPath ) : void
e System
borderColor Color
colorA Color
colorB Color
rect System.Drawing.Rectangle
graphPath System.Drawing.Drawing2D.GraphicsPath
return void
        private void drawBackground(System.Windows.Forms.PaintEventArgs e, Color borderColor, Color colorA, Color colorB, ref Rectangle rect, GraphicsPath graphPath)
        {
            LinearGradientBrush brush = new LinearGradientBrush( rect,
                                                                 colorA,
                                                                 colorB,
                                                                 LinearGradientMode.BackwardDiagonal);
            int borderWidth = _borderWidth;
            if (IsDefault)
                borderWidth += 1;
            Pen pen = new Pen(Color.FromArgb(180, borderColor), borderWidth);
            e.Graphics.FillPath(brush, graphPath);
            e.Graphics.DrawPath(pen, graphPath);
            pen.Dispose();
            brush.Dispose();
        }