Paint.BrushSizeSelector.DrawBrush C# (CSharp) Method

DrawBrush() private method

Draws the brush size representation in the current color
private DrawBrush ( ) : void
return void
        private void DrawBrush()
        {
            // Blank out previous brush first...
            Rectangle blankRectangle = new Rectangle(
                this.Bounds.X + ((this.Bounds.Width - this.brushSizeDefinition.BrushSizeMaximum) / 2 ),
                this.Bounds.Y + (brushSizeDefinition.GaugeVerticalMargin / 2),
                this.brushSizeDefinition.BrushSizeMaximum,
                this.brushSizeDefinition.BrushSizeMaximum);

            this.DrawRectangle(blankRectangle, this.BackgroundColor);

            // draw new brush
            Rectangle brushRectangle = new Rectangle(
                this.Bounds.X + ((this.Bounds.Width - this.BrushSize) / 2 ),
                this.Bounds.Y + (brushSizeDefinition.GaugeVerticalMargin + this.brushSizeDefinition.BrushSizeMaximum - this.BrushSize) / 2,
                this.BrushSize,
                this.BrushSize);

            this.DrawRectangle(brushRectangle, this.Color);
        }