Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

Console.MoveBufferArea Method (Int32, Int32, Int32, Int32, Int32, Int32, Char, ConsoleColor, ConsoleColor)

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

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

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
)
public static function MoveBufferArea (
	sourceLeft : int, 
	sourceTop : int, 
	sourceWidth : int, 
	sourceHeight : int, 
	targetLeft : int, 
	targetTop : int, 
	sourceChar : char, 
	sourceForeColor : ConsoleColor, 
	sourceBackColor : ConsoleColor
)
Not applicable.

Parameters

sourceLeft

The leftmost column of the source area.

sourceTop

The topmost row of the source area.

sourceWidth

The number of columns in the source area.

sourceHeight

The number of rows in the source area.

targetLeft

The leftmost column of the destination area.

targetTop

The topmost row of the destination area.

sourceChar

The character used to fill the source area.

sourceForeColor

The foreground color used to fill the source area.

sourceBackColor

The background color used to fill the source area.

Exception typeCondition

ArgumentOutOfRangeException

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.

ArgumentException

One or both of the color parameters is not a member of the System.ConsoleColor enumeration.

SecurityException

The user does not have permission to perform this action.

IOException

An I/O error occurred.

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.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.