Console.MoveBufferArea Console.MoveBufferArea Console.MoveBufferArea Console.MoveBufferArea Method

Definition

Copies a specified source area of the screen buffer to a specified destination area.

Overloads

MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32) MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32) MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32) 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) MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32, Char, ConsoleColor, ConsoleColor) MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32, Char, ConsoleColor, ConsoleColor) 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) MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32) MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32) 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)

Parameters

sourceLeft
Int32 Int32 Int32 Int32

The leftmost column of the source area.

sourceTop
Int32 Int32 Int32 Int32

The topmost row of the source area.

sourceWidth
Int32 Int32 Int32 Int32

The number of columns in the source area.

sourceHeight
Int32 Int32 Int32 Int32

The number of rows in the source area.

targetLeft
Int32 Int32 Int32 Int32

The leftmost column of the destination area.

targetTop
Int32 Int32 Int32 Int32

The topmost row of the destination area.

Exceptions

One or more of the parameters is less than zero.

-or-

sourceLeft or targetLeft is greater than or equal to BufferWidth.

-or-

sourceTop or targetTop is greater than or equal to BufferHeight.

-or-

sourceTop + sourceHeight is greater than or equal to BufferHeight.

-or-

sourceLeft + sourceWidth is greater than or equal to BufferWidth.

The user does not have permission to perform this action.

Remarks

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.

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.

Security

UIPermission
for modifying safe top-level windows and subwindows. Associated enumeration: SafeTopLevelWindows

MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32, Char, ConsoleColor, ConsoleColor) MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32, Char, ConsoleColor, ConsoleColor) MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32, Char, ConsoleColor, ConsoleColor) 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)

Parameters

sourceLeft
Int32 Int32 Int32 Int32

The leftmost column of the source area.

sourceTop
Int32 Int32 Int32 Int32

The topmost row of the source area.

sourceWidth
Int32 Int32 Int32 Int32

The number of columns in the source area.

sourceHeight
Int32 Int32 Int32 Int32

The number of rows in the source area.

targetLeft
Int32 Int32 Int32 Int32

The leftmost column of the destination area.

targetTop
Int32 Int32 Int32 Int32

The topmost row of the destination area.

sourceChar
Char Char Char Char

The character used to fill the source area.

sourceForeColor
ConsoleColor ConsoleColor ConsoleColor ConsoleColor

The foreground color used to fill the source area.

sourceBackColor
ConsoleColor ConsoleColor ConsoleColor ConsoleColor

The background color used to fill the source area.

Exceptions

One or more of the parameters is less than zero.

-or-

sourceLeft or targetLeft is greater than or equal to BufferWidth.

-or-

sourceTop or targetTop is greater than or equal to BufferHeight.

-or-

sourceTop + sourceHeight is greater than or equal to BufferHeight.

-or-

sourceLeft + sourceWidth is greater than or equal to BufferWidth.

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.

Remarks

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.

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 the character specified by sourceChar, using the colors specified by sourceForeColor and sourceBackColor. Otherwise, the intersected portion of the source area is not filled.

The MoveBufferArea method performs no operation if sourceWidth or sourceHeight is zero.

Security

UIPermission
for modifying safe top-level windows and subwindows. Associated enumeration: SafeTopLevelWindows

Applies to