CalculateBackgroundImageRectangle 方法

计算具有指定布局的背景图像的位置和大小,例如拉伸、居中或缩小。

语法

internal static Rectangle CalculateBackgroundImageRectangle(Rectangle bounds, Image backgroundImage, ImageLayout imageLayout)

参数

bounds
backgroundImage 的客户端矩形。

backgroundImage
要计算其位置和大小的图像。 若为 null,则返回客户端矩形 bounds

imageLayout
指定背景图像位置相对于 bounds 的枚举值之一。

返回

Rectangle
具有指定布局的指定背景图像的位置和大小。

警告

CalculateBackgroundImageRectangle 方法是内部的,不应在代码中直接使用。

在任何情况下,Microsoft 都不支持在生产应用程序中使用此方法。

要求

命名空间:System.Windows.Forms

程序集:System.Windows.Forms(在 System.Windows.Forms.dll 中)

.NET Framework 版本:自 1.0 起可用。

另请参阅