BufferedGraphicsContext::MaximumBuffer Property

 

Gets or sets the maximum size of the buffer to use.

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

public:
property Size MaximumBuffer {
	Size get();
	[UIPermissionAttribute(SecurityAction::Demand, Window = UIPermissionWindow::AllWindows)]
	void set(Size value);
}

Property Value

Type: System.Drawing::Size

A Size indicating the maximum size of the buffer dimensions.

Exception Condition
ArgumentException

The height or width of the size is less than or equal to zero.

This property allows you to get or set the maximum dimensions for a buffer that should be retained in memory. You can allocate a buffer of any size, however any buffer with dimensions greater than the MaximumBuffer size will be used temporarily and then discarded when the BufferedGraphics object is released.

The following example demonstrates setting the maximum size for the buffer for a BufferedGraphicsContext. This code is part of a larger example provided for the BufferedGraphics class.

// Sets the maximum size for the graphics buffer 
// of the buffered graphics context. Any allocation 
// requests for a buffer larger than this will create 
// a temporary buffered graphics context to host 
// the graphics buffer.
appDomainBufferedGraphicsContext->MaximumBuffer = System::Drawing::Size( 400, 400 );

UIPermission

for allowing user access to all windows. Related enumeration: AllWindows

.NET Framework
Available since 2.0
Return to top
Show: