Example #1
0
        public Buffer(int left, int top, int height, int width)
        {
            Left = left;
            Top = top;
            Height = height;
            Width = width;

            buffer = new NativeMethods.CharInfo[width * height];

            Rectangle = new NativeMethods.SmallRect() { Top = (short)Top, Left = (short)Left, Bottom = (short)(Top + Height), Right = (short)(Left + Width) };
        }
Example #2
0
        public Buffer(int left, int top, int height, int width)
        {
            Left   = left;
            Top    = top;
            Height = height;
            Width  = width;

            buffer = new NativeMethods.CharInfo[width * height];

            Rectangle = new NativeMethods.SmallRect()
            {
                Top = (short)Top, Left = (short)Left, Bottom = (short)(Top + Height), Right = (short)(Left + Width)
            };
        }
Example #3
0
        internal static void Paint(int left, int top, int height, int width, Buffer buffer)
        {
            var rectangle = new NativeMethods.SmallRect()
            {
                Top = (short)top, Left = (short)left, Bottom = (short)(top + height), Right = (short)(left + width)
            };
            var coord = new NativeMethods.Coord((short)left, (short)top);

            bool b = WriteConsoleOutput(OutputHandle, buffer.Value,
                                        buffer.Size,
                                        coord,
                                        ref rectangle);

            if (!b)
            {
                var e = new Win32Exception();

                System.Diagnostics.Debug.WriteLine(e.Message);
            }
        }
Example #4
0
        internal static void Paint(int left, int top, int height, int width, Buffer buffer)
        {
            var rectangle = new NativeMethods.SmallRect() { Top = (short)top, Left = (short)left, Bottom = (short)(top + height), Right = (short)(left + width) };
            var coord = new NativeMethods.Coord((short)left, (short)top);

            bool b = WriteConsoleOutput(OutputHandle, buffer.Value,
              buffer.Size,
              coord,
              ref rectangle);

            if (!b)
            {
                var e = new Win32Exception();

                System.Diagnostics.Debug.WriteLine(e.Message);
            }
        }