Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SetBufferSize()

static void System.ConsolePal.SetBufferSize ( int width,
int height )
inlinestatic

Definition at line 849 of file ConsolePal.cs.

850 {
851 global::Interop.Kernel32.SMALL_RECT srWindow = GetBufferInfo().srWindow;
852 if (width < srWindow.Right + 1 || width >= 32767)
853 {
854 throw new ArgumentOutOfRangeException("width", width, System.SR.ArgumentOutOfRange_ConsoleBufferLessThanWindowSize);
855 }
856 if (height < srWindow.Bottom + 1 || height >= 32767)
857 {
858 throw new ArgumentOutOfRangeException("height", height, System.SR.ArgumentOutOfRange_ConsoleBufferLessThanWindowSize);
859 }
860 global::Interop.Kernel32.COORD size = default(global::Interop.Kernel32.COORD);
861 size.X = (short)width;
862 size.Y = (short)height;
863 if (!global::Interop.Kernel32.SetConsoleScreenBufferSize(OutputHandle, size))
864 {
866 }
867 }
static IntPtr OutputHandle
static global::Interop.Kernel32.CONSOLE_SCREEN_BUFFER_INFO GetBufferInfo()
static Exception GetExceptionForWin32Error(int errorCode, string path="")
static string ArgumentOutOfRange_ConsoleBufferLessThanWindowSize
Definition SR.cs:70
Definition SR.cs:7

References System.SR.ArgumentOutOfRange_ConsoleBufferLessThanWindowSize, System.ConsolePal.GetBufferInfo(), System.IO.Win32Marshal.GetExceptionForWin32Error(), System.Runtime.InteropServices.Marshal.GetLastPInvokeError(), and System.ConsolePal.OutputHandle.

Referenced by System.Console.SetBufferSize().