Paint.ColorSetter.Draw C# (CSharp) Method

Draw() public method

Draw this tool on to the image
public Draw ( bool refreshDisplay ) : void
refreshDisplay bool /// True = we should redraw the entire control /// False = just draw any updates ///
return void
        public void Draw(bool refreshDisplay)
        {
            if (this.color != this.previousColor || refreshDisplay == true)
            {
                // Blank out everything
                this.DrawRectangle(this.colorSetterDefinition.Bounds, this.colorSetterDefinition.BorderColor);

                Rectangle inBorderRectangle = new Rectangle(
                    this.colorSetterDefinition.Bounds.X + this.colorSetterDefinition.BorderWidth,
                    this.colorSetterDefinition.Bounds.Y + this.colorSetterDefinition.BorderWidth,
                    this.colorSetterDefinition.Bounds.Width - (2 * this.colorSetterDefinition.BorderWidth),
                    this.colorSetterDefinition.Bounds.Height - (2 * this.colorSetterDefinition.BorderWidth));

                this.DrawRectangle(inBorderRectangle, this.Color);

                this.previousColor = this.color;
            }
        }