Longkong.ColorPicker.Controls.ColorSwatchPanel.OnPaint C# (CSharp) Method

OnPaint() protected method

protected OnPaint ( PaintEventArgs pe ) : void
pe PaintEventArgs
return void
        protected override void OnPaint(PaintEventArgs pe)
        {
            ControlPaint.DrawBorder3D( pe.Graphics, new Rectangle( 0, 0, m_swatchOuterRegionWidth, m_swatchOuterRegionHeight ) );

            if ( m_swatchBitmap == null ) {
                m_swatchBitmap = BuildSwatchBitmap();
            }
            pe.Graphics.DrawImage( m_swatchBitmap, new Rectangle( new Point( 0, 0 ), new Size( m_swatchBitmap.Width, m_swatchBitmap.Height ) ) );

            if ( m_paintActiveEmptySwatch ) {

                Rectangle rect = new Rectangle( m_nextEmptySwatchPoint, new Size( SWATCH_WIDTH, SWATCH_HEIGHT ) );
                pe.Graphics.DrawRectangle( Pens.Yellow, rect );

            }
        }