BufferedGraphicsContext.MaximumBuffer Property

Definition

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

public:
 property System::Drawing::Size MaximumBuffer { System::Drawing::Size get(); void set(System::Drawing::Size value); };
public System.Drawing.Size MaximumBuffer { get; set; }
member this.MaximumBuffer : System.Drawing.Size with get, set
Public Property MaximumBuffer As Size

Property Value

A Size indicating the maximum size of the buffer dimensions.

Exceptions

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

Examples

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 );
// 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 = new Size(400, 400);
' 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 = New Size(400, 400)

Remarks

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.

Applies to

See also