System.Windows.Forms.ColorPickerForm.BrightnessSaturationPicker.OnPaint C# (CSharp) Method

OnPaint() protected method

protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
return void
            protected override void OnPaint(PaintEventArgs e)
            {
                if (_image != null)
                    e.Graphics.DrawTexture(_image, 0, 0, Width, Height);

                e.Graphics.DrawRectangle(new Pen(Color.White), Saturation * Width - 2, Height - Brightness * Height - 2, 4, 4);

                var borderColor = BorderColor;
                if (Hovered) borderColor = BorderHoverColor;
                e.Graphics.DrawRectangle(new Pen(borderColor), 0, 0, Width, Height);
            }