BufferedGraphicsContext.MaximumBuffer 属性

定义

获取或设置要使用的缓冲区的最大大小。

C#
public System.Drawing.Size MaximumBuffer { get; set; }

属性值

一个 Size,指示缓冲区尺寸的最大大小。

例外

缓冲区大小的高度或宽度小于或等于零。

示例

以下示例演示如何设置 缓冲区 BufferedGraphicsContext的最大大小。 此代码是为 类提供的更大示例的 BufferedGraphics 一部分。

C#
// 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);

注解

此属性允许获取或设置应在内存中保留的缓冲区的最大维度。 可以分配任何大小的缓冲区,但维度大于该 MaximumBuffer 大小的缓冲区将暂时使用,然后在释放对象时 BufferedGraphics 放弃。

适用于

产品 版本
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

另请参阅