Beispiel #1
0
 public void DrawBorder(BorderThickness thickness, int x, int y, int width, int height, ConsoleColor borderTopColor,
                        ConsoleColor borderRightColor, ConsoleColor borderBottomColor, ConsoleColor borderLeftColor,
                        ConsoleColor backgroundColor)
 {
     this.graphics.DrawBorder(thickness, xOffset + x, yOffset + y, width, height,
                              borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, backgroundColor);
 }
Beispiel #2
0
        public void DrawBorder(
            BorderThickness thickness,
            int x, int y, int width, int height,
            ConsoleColor borderTopColor,
            ConsoleColor borderRightColor,
            ConsoleColor borderBottomColor,
            ConsoleColor borderLeftColor,
            ConsoleColor backgroundColor)
        {
            var topBorder   = AsciiCodes.GetBorderChars(thickness.Top);
            var leftBorder  = AsciiCodes.GetBorderChars(thickness.Left);
            var rightBorder = AsciiCodes.GetBorderChars(thickness.Right);
            var botBorder   = AsciiCodes.GetBorderChars(thickness.Bottom);

            // draw vertical lines
            for (var i = 0; i < height - 1; i++)
            {
                SetPixel(leftBorder[3], x, y + i + 1, borderLeftColor, backgroundColor);
                SetPixel(rightBorder[3], x + width, y + i + 1, borderRightColor, backgroundColor);
            }

            // draw top corners
            SetPixel(topBorder[0], x, y, borderTopColor, backgroundColor);
            SetPixel(topBorder[1], x + width, y, borderTopColor, backgroundColor);

            // draw horizontal lines
            for (var i = 0; i < width - 1; i++)
            {
                SetPixel(topBorder[2], x + i + 1, y, borderTopColor, backgroundColor);
                SetPixel(botBorder[2], x + i + 1, y + height, borderBottomColor, backgroundColor);
            }

            // draw bottom corners
            SetPixel(botBorder[4], x, y + height, borderBottomColor, backgroundColor);
            SetPixel(botBorder[5], x + width, y + height, borderBottomColor, backgroundColor);
        }
Beispiel #3
0
 public void DrawBorder(BorderThickness thickness, int x, int y, int width, int height, ConsoleColor borderColor, ConsoleColor backgroundColor)
 {
     DrawBorder(thickness, x, y, width, height, borderColor, borderColor, borderColor, borderColor,
                backgroundColor);
 }