DrawLine() публичный Метод

public DrawLine ( int x1, int y1, int x2, int y2 ) : void
x1 int
y1 int
x2 int
y2 int
Результат void
Пример #1
0
 protected override void OnPaint(ConsoleBitmap context)
 {
     context.Pen = new ConsoleCharacter(' ', null, myFocusStackDepth == Application.FocusManager.StackDepth ? Theme.DefaultTheme.H1Color : Theme.DefaultTheme.DisabledColor);
     context.DrawLine(0, 0, Width, 0);
     context.DrawLine(0, Height - 1, Width, Height - 1);
     base.OnPaint(context);
 }
Пример #2
0
        protected override void OnPaint(ConsoleBitmap context)
        {
            var borderChar = new ConsoleCharacter(' ', Foreground, BorderColor);

            context.DrawRect(borderChar, 0, 0, Width, Height - 1);
            context.DrawLine(borderChar, 1, 1, 1, Height - 1);
            context.DrawLine(borderChar, Width - 2, 1, Width - 2, Height - 1);
            // todo - that minus 3 should be a 2, but I'm not sure why this makes it work.
            // I'm afraid there's an off by 1 somewhere deep in the code that processes rectangles.
            // I'll need to investigate at some point. If I end up fixing that bug then it's likely this line
            // will stop working.  So if it ever looks like the content of this panel is not having it's last line
            // painted then it's likely that I fixed the other bug and this this.Height - 3 needs to be changed to a this.Height - 2.
            context.Rescope(2, 1, this.Width - 4, this.Height - 3);
            base.OnPaint(context);
        }
Пример #3
0
        private void RenderThreshold(ConsoleBitmap context, DataSeries series)
        {
            if (series.Threshold == null) return;

            var yPixel = ConvertYValueToPixel(series.Threshold.Value);

            context.Pen = new ConsoleCharacter('-', series.Threshold.PlotColor, Background);
            context.DrawLine(XAxisLeft, yPixel, XAxisRight, yPixel);

            var title = series.Threshold.Title;

            if(title.Length > XAxisWidth-2)
            {
                title = series.Threshold.Title.Substring(0, XAxisWidth - 3) + "_";
            }

            context.DrawString(new ConsoleString(title, series.Threshold.PlotColor), XAxisLeft + 1, yPixel);
        }
Пример #4
0
 protected override void OnPaint(ConsoleBitmap context)
 {
     context.Pen = new ConsoleCharacter(' ', null, myFocusStackDepth == Application.FocusManager.StackDepth ? Theme.DefaultTheme.H1Color : Theme.DefaultTheme.DisabledColor);
     context.DrawLine(0, 0, Width, 0);
     context.DrawLine(0, Height-1, Width, Height-1);
     base.OnPaint(context);
 }
Пример #5
0
 private void RenderXAxis(ConsoleBitmap context)
 {
     context.Pen = new ConsoleCharacter(XAxisChar, Foreground, Background);
     context.DrawLine(YAxisLeftOffset, XAxisYValue, XAxisRight, XAxisYValue);
     RenderXAxisLabels(context);
 }
Пример #6
0
 private void RenderYAxis(ConsoleBitmap context)
 {
     context.Pen = new ConsoleCharacter(YAxisChar, Foreground.ForegroundColor, Foreground.BackgroundColor);
     context.DrawLine(YAxisLeftOffset, YAxisTop, YAxisLeftOffset, XAxisYValue + 1);
     RenderYAxisLabels(context);
 }