Console.MoveBufferArea 方法

定義

將螢幕緩衝區的指定之來源區域複製到指定之目標區域中。

多載

MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32)

將螢幕緩衝區的指定之來源區域複製到指定之目標區域中。

MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32, Char, ConsoleColor, ConsoleColor)

將螢幕緩衝區的指定之來源區域複製到指定之目標區域中。

MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32)

將螢幕緩衝區的指定之來源區域複製到指定之目標區域中。

public:
 static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop);
public static void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member MoveBufferArea : int * int * int * int * int * int -> unit
static member MoveBufferArea : int * int * int * int * int * int -> unit
Public Shared Sub MoveBufferArea (sourceLeft As Integer, sourceTop As Integer, sourceWidth As Integer, sourceHeight As Integer, targetLeft As Integer, targetTop As Integer)

參數

sourceLeft
Int32

來源區域最左邊的資料行。

sourceTop
Int32

來源區域最上方的資料列。

sourceWidth
Int32

來源區域中的資料行數。

sourceHeight
Int32

來源區域中的資料列數。

targetLeft
Int32

目的區域最左邊的資料行。

targetTop
Int32

目的區域最上方的資料列。

屬性

例外狀況

一或多個參數小於零。

-或-

sourceLefttargetLeft 大於或等於 BufferWidth

-或-

sourceToptargetTop 大於或等於 BufferHeight

-或-

sourceTop + sourceHeight 大於或等於 BufferHeight

-或-

sourceLeft + sourceWidth 大於或等於 BufferWidth

使用者沒有執行這項動作的權限。

發生 I/O 錯誤。

目前的作業系統不是 Windows。

備註

如果目的地和來源參數指定的位置位於目前螢幕緩衝區的範圍之外,則只會複製位於目的區域內之來源區域的部分。 也就是說,會裁剪來源區域以符合目前的螢幕緩衝區。

MoveBufferArea方法會將來源區域複製到目的區域。 如果目的地區域不會與來源區域相交,則會使用目前的前景和背景色彩,將來源區域填滿空白。 否則,不會填入來源區域的交集部分。

適用於

MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32, Char, ConsoleColor, ConsoleColor)

將螢幕緩衝區的指定之來源區域複製到指定之目標區域中。

public:
 static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor);
public static void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member MoveBufferArea : int * int * int * int * int * int * char * ConsoleColor * ConsoleColor -> unit
static member MoveBufferArea : int * int * int * int * int * int * char * ConsoleColor * ConsoleColor -> unit
Public Shared Sub MoveBufferArea (sourceLeft As Integer, sourceTop As Integer, sourceWidth As Integer, sourceHeight As Integer, targetLeft As Integer, targetTop As Integer, sourceChar As Char, sourceForeColor As ConsoleColor, sourceBackColor As ConsoleColor)

參數

sourceLeft
Int32

來源區域最左邊的資料行。

sourceTop
Int32

來源區域最上方的資料列。

sourceWidth
Int32

來源區域中的資料行數。

sourceHeight
Int32

來源區域中的資料列數。

targetLeft
Int32

目的區域最左邊的資料行。

targetTop
Int32

目的區域最上方的資料列。

sourceChar
Char

用來填滿來源區域的字元。

sourceForeColor
ConsoleColor

用來填滿來源區域的前景色彩。

sourceBackColor
ConsoleColor

用來填滿來源區域的背景色彩。

屬性

例外狀況

一或多個參數小於零。

-或-

sourceLefttargetLeft 大於或等於 BufferWidth

-或-

sourceToptargetTop 大於或等於 BufferHeight

-或-

sourceTop + sourceHeight 大於或等於 BufferHeight

-或-

sourceLeft + sourceWidth 大於或等於 BufferWidth

色彩參數之一或兩者都不是 ConsoleColor 列舉的成員。

使用者沒有執行這項動作的權限。

發生 I/O 錯誤。

目前的作業系統不是 Windows。

備註

如果目的地和來源參數指定的位置超出目前螢幕緩衝區的範圍,則只會複製位於目的區域內之來源區域的部分。 也就是說,會裁剪來源區域以符合目前的螢幕緩衝區。

MoveBufferArea方法會將來源區域複製到目的區域。 如果目的地區域不會與來源區域相交,則會 sourceChar 使用和指定的色彩,以指定的字元填入來源區域 sourceForeColor sourceBackColor 。 否則,不會填入來源區域的交集部分。

MoveBufferArea如果 sourceWidth 或為零,則方法不會執行任何作業 sourceHeight

適用於