Console.MoveBufferArea 方法

定义

将屏幕缓冲区的指定源区域复制到指定的目标区域。Copies a specified source area of the screen buffer to a specified destination area.

重载

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

将屏幕缓冲区的指定源区域复制到指定的目标区域。Copies a specified source area of the screen buffer to a specified destination area.

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

将屏幕缓冲区的指定源区域复制到指定的目标区域。Copies a specified source area of the screen buffer to a specified destination area.

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

将屏幕缓冲区的指定源区域复制到指定的目标区域。Copies a specified source area of the screen buffer to a specified destination area.

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);
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

源区域最左边的列。The leftmost column of the source area.

sourceTop
Int32

源区域最顶部的行。The topmost row of the source area.

sourceWidth
Int32

源区域中列的数目。The number of columns in the source area.

sourceHeight
Int32

源区域中行的数目。The number of rows in the source area.

targetLeft
Int32

目标区域最左边的列。The leftmost column of the destination area.

targetTop
Int32

目标区域最顶部的行。The topmost row of the destination area.

异常

一个或多个参数小于零。One or more of the parameters is less than zero.

- 或 --or- sourceLefttargetLeft 大于或等于 BufferWidthsourceLeft or targetLeft is greater than or equal to BufferWidth.

- 或 --or- sourceToptargetTop 大于或等于 BufferHeightsourceTop or targetTop is greater than or equal to BufferHeight.

- 或 --or- sourceTop + sourceHeight 大于或等于 BufferHeightsourceTop + sourceHeight is greater than or equal to BufferHeight.

- 或 --or- sourceLeft + sourceWidth 大于或等于 BufferWidthsourceLeft + sourceWidth is greater than or equal to BufferWidth.

用户没有执行此操作的权限。The user does not have permission to perform this action.

出现 I/O 错误。An I/O error occurred.

当前操作系统不是 Windows。The current operating system is not Windows.

注解

如果 destination 和 source 参数指定的位置位于当前屏幕缓冲区的边界之外,则仅复制目标区域内容纳的源区域部分。If the destination and source parameters specify a position located outside the boundaries of the current screen buffer, only the portion of the source area that fits within the destination area is copied. 也就是说,将剪裁源区域以适合当前屏幕缓冲区。That is, the source area is clipped to fit the current screen buffer.

MoveBufferArea 方法将源区域复制到目标区域。The MoveBufferArea method copies the source area to the destination area. 如果目标区域与源区域不相交,则使用当前前景色和背景色填充源区域的空白区域。If the destination area does not intersect the source area, the source area is filled with blanks using the current foreground and background colors. 否则,不会填充源区域的相交部分。Otherwise, the intersected portion of the source area is not filled.

安全性

UIPermission
用于修改安全顶级窗口和子窗口。for modifying safe top-level windows and subwindows. 关联的枚举: SafeTopLevelWindowsAssociated enumeration: SafeTopLevelWindows

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

将屏幕缓冲区的指定源区域复制到指定的目标区域。Copies a specified source area of the screen buffer to a specified destination area.

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);
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

源区域最左边的列。The leftmost column of the source area.

sourceTop
Int32

源区域最顶部的行。The topmost row of the source area.

sourceWidth
Int32

源区域中列的数目。The number of columns in the source area.

sourceHeight
Int32

源区域中行的数目。The number of rows in the source area.

targetLeft
Int32

目标区域最左边的列。The leftmost column of the destination area.

targetTop
Int32

目标区域最顶部的行。The topmost row of the destination area.

sourceChar
Char

用于填充源区域的字符。The character used to fill the source area.

sourceForeColor
ConsoleColor

用于填充源区域的前景色。The foreground color used to fill the source area.

sourceBackColor
ConsoleColor

用于填充源区域的背景色。The background color used to fill the source area.

异常

一个或多个参数小于零。One or more of the parameters is less than zero.

- 或 --or- sourceLefttargetLeft 大于或等于 BufferWidthsourceLeft or targetLeft is greater than or equal to BufferWidth.

- 或 --or- sourceToptargetTop 大于或等于 BufferHeightsourceTop or targetTop is greater than or equal to BufferHeight.

- 或 --or- sourceTop + sourceHeight 大于或等于 BufferHeightsourceTop + sourceHeight is greater than or equal to BufferHeight.

- 或 --or- sourceLeft + sourceWidth 大于或等于 BufferWidthsourceLeft + sourceWidth is greater than or equal to BufferWidth.

一个或两个颜色参数不是 ConsoleColor 枚举的成员。One or both of the color parameters is not a member of the ConsoleColor enumeration.

用户没有执行此操作的权限。The user does not have permission to perform this action.

出现 I/O 错误。An I/O error occurred.

当前操作系统不是 Windows。The current operating system is not Windows.

注解

如果 destination 参数和 source 参数指定的位置超出了当前屏幕缓冲区的边界,则仅复制目标区域内容纳的源区域部分。If the destination and source parameters specify a position located beyond the boundaries of the current screen buffer, only the portion of the source area that fits within the destination area is copied. 也就是说,将剪裁源区域以适合当前屏幕缓冲区。That is, the source area is clipped to fit the current screen buffer.

MoveBufferArea 方法将源区域复制到目标区域。The MoveBufferArea method copies the source area to the destination area. 如果目标区域与源区域不相交,则使用 sourceForeColorsourceBackColor指定的颜色,用 sourceChar指定的字符填充源区域。If the destination area does not intersect the source area, the source area is filled with the character specified by sourceChar, using the colors specified by sourceForeColor and sourceBackColor. 否则,不会填充源区域的相交部分。Otherwise, the intersected portion of the source area is not filled.

如果 sourceWidthsourceHeight 为零,则 MoveBufferArea 方法不执行任何操作。The MoveBufferArea method performs no operation if sourceWidth or sourceHeight is zero.

安全性

UIPermission
用于修改安全顶级窗口和子窗口。for modifying safe top-level windows and subwindows. 关联的枚举: SafeTopLevelWindowsAssociated enumeration: SafeTopLevelWindows

适用于