ControlPaint.DrawGrid(Graphics, Rectangle, Size, Color) 方法

定义

在指定的边界内、指定的图形表面上,按指定颜色绘制由点(大小为一个像素,互相之间具有指定的间距)组成的网格。

public:
 static void DrawGrid(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle area, System::Drawing::Size pixelsBetweenDots, System::Drawing::Color backColor);
public static void DrawGrid (System.Drawing.Graphics graphics, System.Drawing.Rectangle area, System.Drawing.Size pixelsBetweenDots, System.Drawing.Color backColor);
static member DrawGrid : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Size * System.Drawing.Color -> unit
Public Shared Sub DrawGrid (graphics As Graphics, area As Rectangle, pixelsBetweenDots As Size, backColor As Color)

参数

graphics
Graphics

要进行绘制的 Graphics

area
Rectangle

表示网格尺寸的 Rectangle

pixelsBetweenDots
Size

指定了网格点之间的高度和宽度的 Size

backColor
Color

网格的背景的 Color

注解

参数 backColor 用于计算点的填充颜色,以便网格在背景中始终可见。

适用于