ComponentFactory.Krypton.Toolkit.RenderSparkle.DrawInputControlNumericUpGlyph C# (CSharp) Method

DrawInputControlNumericUpGlyph() public method

Draw a numeric up button image appropriate for a input control.
public DrawInputControlNumericUpGlyph ( RenderContext context, Rectangle cellRect, IPaletteContent paletteContent, PaletteState state ) : void
context RenderContext Render context.
cellRect System.Drawing.Rectangle Available drawing rectangle space.
paletteContent IPaletteContent Content palette for getting colors.
state PaletteState State associated with rendering.
return void
        public override void DrawInputControlNumericUpGlyph(RenderContext context,
                                                            Rectangle cellRect,
                                                            IPaletteContent paletteContent,
                                                            PaletteState state)
        {
            Debug.Assert(context != null);
            Debug.Assert(paletteContent != null);

            // Validate parameter references
            if (context == null) throw new ArgumentNullException("context");
            if (paletteContent == null) throw new ArgumentNullException("paletteContent");

            Color c1 = paletteContent.GetContentShortTextColor1(state);

            // Find the top left starting position for drawing lines
            int xStart = cellRect.Left + (cellRect.Right - cellRect.Left - 4) / 2;
            int yStart = cellRect.Top + (cellRect.Bottom - cellRect.Top - 3) / 2;

            using (Pen darkPen = new Pen(c1))
            {
                context.Graphics.DrawLine(darkPen, xStart, yStart + 3, xStart + 4, yStart + 3);
                context.Graphics.DrawLine(darkPen, xStart + 1, yStart + 2, xStart + 3, yStart + 2);
                context.Graphics.DrawLine(darkPen, xStart + 2, yStart + 2, xStart + 2, yStart + 1);
            }
        }