Ejemplo n.º 1
0
 public static extern bool WriteConsoleOutput(
     IntPtr hConsoleOutput,
     CHAR_INFO[,] lpBuffer,
     COORD dwBufferSize,
     COORD dwBufferCoord,
     ref SMALL_RECT lpWriteRegion
     );
Ejemplo n.º 2
0
 public RenderingBuffer(int width, int height)
 {
     buffer        = new CHAR_INFO[width, height];
     opacityMatrix = new int[width, height];
     this.width    = width;
     this.height   = height;
 }
Ejemplo n.º 3
0
 public RenderingBuffer(int width, int height)
 {
     buffer = new CHAR_INFO[width, height];
     opacityMatrix = new int[width, height];
     this.width = width;
     this.height = height;
 }
Ejemplo n.º 4
0
 public BufferWriter(CHAR_INFO[,] buffer)
 {
     this.buffer = buffer;
     x           = 0;
     y           = 0;
     MaxX        = 0;
     MaxY        = 0;
 }
Ejemplo n.º 5
0
        public static extern bool ReadConsoleOutput(
            IntPtr hConsoleOutput,

            /* This pointer is treated as the origin of a two-dimensional array of CHAR_INFO structures
             * whose size is specified by the dwBufferSize parameter.*/
            [MarshalAs(UnmanagedType.LPArray), Out] CHAR_INFO[,] lpBuffer,
            COORD dwBufferSize,
            COORD dwBufferCoord,
            ref SMALL_RECT lpReadRegion);
Ejemplo n.º 6
0
        public static extern bool WriteConsoleOutput(
            IntPtr hConsoleOutput, // screen buffer to write on

            /* This pointer is treated as the origin of a two-dimensional array of CHAR_INFO structures
             * whose size is specified by the dwBufferSize parameter.*/
            [MarshalAs(UnmanagedType.LPArray), In] CHAR_INFO[,] lpBuffer, // 2d array of content to write
            COORD dwBufferSize,                                           // size of lpBuffer
            COORD dwBufferCoord,                                          // what part of content to write to start writing from
            ref SMALL_RECT lpWriteRegion);                                // region of screen buffer to write on
Ejemplo n.º 7
0
 public void CopyFrom(RenderingBuffer renderingBuffer) {
     this.buffer = new CHAR_INFO[renderingBuffer.width, renderingBuffer.height];
     this.opacityMatrix = new int[renderingBuffer.width, renderingBuffer.height];
     this.width = renderingBuffer.width;
     this.height = renderingBuffer.height;
     //
     for (int x = 0; x < width; x++) {
         for (int y = 0; y < height; y++) {
             buffer[x, y] = renderingBuffer.buffer[x, y];
             opacityMatrix[x, y] = renderingBuffer.opacityMatrix[x, y];
         }
     }
 }
Ejemplo n.º 8
0
 public void CopyFrom(RenderingBuffer renderingBuffer)
 {
     this.buffer        = new CHAR_INFO[renderingBuffer.width, renderingBuffer.height];
     this.opacityMatrix = new int[renderingBuffer.width, renderingBuffer.height];
     this.width         = renderingBuffer.width;
     this.height        = renderingBuffer.height;
     //
     for (int x = 0; x < width; x++)
     {
         for (int y = 0; y < height; y++)
         {
             buffer[x, y]        = renderingBuffer.buffer[x, y];
             opacityMatrix[x, y] = renderingBuffer.opacityMatrix[x, y];
         }
     }
 }
        public WindowsStructuredReportConsoleRenderer()
        {
            Console.OutputEncoding = Encoding.Unicode;

            bufferSize.X = 256;
            bufferSize.Y = 256;
            buffer       = new CHAR_INFO[bufferSize.Y, bufferSize.X];

            var currentAttributes = (CharInfoAttributes)(((ushort)Console.BackgroundColor << 4) | (ushort)Console.ForegroundColor);

            for (var y = 0; y < bufferSize.Y; y++)
            {
                for (var x = 0; x < bufferSize.X; x++)
                {
                    buffer[y, x].Attributes = currentAttributes;
                }
            }
        }
Ejemplo n.º 10
0
 internal static extern bool WriteConsoleOutput(
     IntPtr hConsoleOutput,
     CHAR_INFO[,] buffer,
     COORD bufferSize,
     COORD bufferCoord,
     ref SMALL_RECT writeRegion);
Ejemplo n.º 11
0
 private static extern bool ReadConsoleOutput(IntPtr hConsoleBuffer, [MarshalAs(UnmanagedType.LPArray), Out] CHAR_INFO[,] lpBuffer,
                                              COORD BufferSize, COORD BufferCoord, ref SMALL_RECT lpReadRegion);