System.Windows.Forms.ColorPickerForm.HuePicker.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.DrawLine(new Pen(Color.White), 0, Hue * Height, Width, Hue * Height);

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