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 是用來計算點的填滿色彩,讓格線一律在背景上可見。

適用於