public static extern bool ScrollConsoleScreenBuffer( IntPtr hConsoleOutput, [In] ref SMALL_RECT lpScrollRectangle, IntPtr lpClipRectangle, COORD dwDestinationOrigin, [In] ref CHAR_INFO lpFill );
protected override void Setup() { var letterA = new CHAR_INFO { AsciiChar = 'A', }; letterA.Attributes = (UInt16) (FOREGROUND_RED | FOREGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_INTENSITY); var charBufSize = new COORD { X = 1, Y = 1, }; var characterPos = new COORD { X = 0, Y = 0, }; var writeArea = new SMALL_RECT { Left = 0, Top = 0, Right = 0, Bottom = 0, }; WriteConsoleOutput( WriteHandle, new CHAR_INFO[] { letterA }, charBufSize, characterPos, ref writeArea); Console.Write("\n"); }
protected override void Setup() { var consoleBuffer = new CHAR_INFO[Width * Height]; for (int h = 0; h < Height; ++h) { for (int w = 0; w < Width; ++w) { consoleBuffer[w + Width * h].AsciiChar = 'A'/*(char)Random.Next(256)*/; consoleBuffer[w + Width * h].Attributes = (UInt16)Random.Next(256); } } var charBufSize = new COORD { X = Width, Y = Height, }; var characterPos = new COORD { X = 0, Y = 0, }; WriteConsoleOutput( WriteHandle, consoleBuffer, charBufSize, characterPos, ref WindowSize); }
public static extern bool WriteConsoleOutput( IntPtr hConsoleOutput, CHAR_INFO[] lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, ref SMALL_RECT lpWriteRegion );