コード例 #1
0
        public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill)
        {
            if (source.Left > clip.Right || source.Right < clip.Left || source.Top > clip.Bottom || source.Bottom < clip.Top)
            {
                return;
            }
            IntPtr stdHandle = PS2EXEHostRawUI.GetStdHandle(-11);

            PS2EXEHostRawUI.SMALL_RECT sMALLRECT = new PS2EXEHostRawUI.SMALL_RECT()
            {
                Left   = (short)source.Left,
                Top    = (short)source.Top,
                Right  = (short)source.Right,
                Bottom = (short)source.Bottom
            };
            PS2EXEHostRawUI.SMALL_RECT sMALLRECT1 = sMALLRECT;
            PS2EXEHostRawUI.SMALL_RECT sMALLRECT2 = new PS2EXEHostRawUI.SMALL_RECT()
            {
                Left   = (short)clip.Left,
                Top    = (short)clip.Top,
                Right  = (short)clip.Right,
                Bottom = (short)clip.Bottom
            };
            PS2EXEHostRawUI.SMALL_RECT sMALLRECT3 = sMALLRECT2;
            PS2EXEHostRawUI.COORD      cOORD      = new PS2EXEHostRawUI.COORD()
            {
                X = (short)destination.X,
                Y = (short)destination.Y
            };
            PS2EXEHostRawUI.COORD     cOORD1   = cOORD;
            PS2EXEHostRawUI.CHAR_INFO cHARINFO = new PS2EXEHostRawUI.CHAR_INFO()
            {
                AsciiChar  = fill.Character,
                Attributes = (ushort)((int)fill.ForegroundColor + (int)fill.BackgroundColor * 16)
            };
            PS2EXEHostRawUI.CHAR_INFO cHARINFO1 = cHARINFO;
            PS2EXEHostRawUI.ScrollConsoleScreenBuffer(stdHandle, ref sMALLRECT1, ref sMALLRECT3, cOORD1, ref cHARINFO1);
        }