Graphics.FillRectangles 메서드

정의

Rectangle 구조체에 의해 지정된 일련의 사각형의 내부를 채웁니다.

오버로드

FillRectangles(Brush, ReadOnlySpan<RectangleF>)
FillRectangles(Brush, ReadOnlySpan<Rectangle>)
FillRectangles(Brush, RectangleF[])

RectangleF 구조체에 의해 지정된 일련의 사각형의 내부를 채웁니다.

FillRectangles(Brush, Rectangle[])

Rectangle 구조체에 의해 지정된 일련의 사각형의 내부를 채웁니다.

FillRectangles(Brush, ReadOnlySpan<RectangleF>)

Source:
Graphics.cs
public:
 void FillRectangles(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::RectangleF> rects);
public void FillRectangles (System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.RectangleF> rects);
member this.FillRectangles : System.Drawing.Brush * ReadOnlySpan<System.Drawing.RectangleF> -> unit
Public Sub FillRectangles (brush As Brush, rects As ReadOnlySpan(Of RectangleF))

매개 변수

brush
Brush

적용 대상

FillRectangles(Brush, ReadOnlySpan<Rectangle>)

Source:
Graphics.cs
public:
 void FillRectangles(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::Rectangle> rects);
public void FillRectangles (System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.Rectangle> rects);
member this.FillRectangles : System.Drawing.Brush * ReadOnlySpan<System.Drawing.Rectangle> -> unit
Public Sub FillRectangles (brush As Brush, rects As ReadOnlySpan(Of Rectangle))

매개 변수

brush
Brush

적용 대상

FillRectangles(Brush, RectangleF[])

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

RectangleF 구조체에 의해 지정된 일련의 사각형의 내부를 채웁니다.

public:
 void FillRectangles(System::Drawing::Brush ^ brush, cli::array <System::Drawing::RectangleF> ^ rects);
public:
 void FillRectangles(System::Drawing::Brush ^ brush, ... cli::array <System::Drawing::RectangleF> ^ rects);
public void FillRectangles (System.Drawing.Brush brush, System.Drawing.RectangleF[] rects);
public void FillRectangles (System.Drawing.Brush brush, params System.Drawing.RectangleF[] rects);
member this.FillRectangles : System.Drawing.Brush * System.Drawing.RectangleF[] -> unit
Public Sub FillRectangles (brush As Brush, rects As RectangleF())
Public Sub FillRectangles (brush As Brush, ParamArray rects As RectangleF())

매개 변수

brush
Brush

채우기의 특징을 결정하는 Brush입니다.

rects
RectangleF[]

채울 사각형을 나타내는 RectangleF 구조체의 배열입니다.

예외

brush이(가) null인 경우

또는

rects이(가) null인 경우

Rects이 길이가 0인 배열입니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • 단색 파란색 브러시를 만듭니다.

  • 3개의 사각형 배열을 만듭니다.

  • 화면에 있는 세 개의 사각형 영역을 채웁니다.

public:
   void FillRectanglesRectangleF( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ blueBrush = gcnew SolidBrush( Color::Blue );

      // Create array of rectangles.
      array<RectangleF>^ rects = {RectangleF(0.0F,0.0F,100.0F,200.0F),RectangleF(100.0F,200.0F,250.0F,50.0F),RectangleF(300.0F,0.0F,50.0F,100.0F)};

      // Fill rectangles to screen.
      e->Graphics->FillRectangles( blueBrush, rects );
   }
private void FillRectanglesRectangleF(PaintEventArgs e)
{

    // Create solid brush.
    SolidBrush blueBrush = new SolidBrush(Color.Blue);

    // Create array of rectangles.
    RectangleF[] rects = { new RectangleF(0.0F, 0.0F, 100.0F, 200.0F), new RectangleF(100.0F, 200.0F, 250.0F, 50.0F), new RectangleF(300.0F, 0.0F, 50.0F, 100.0F) };

    // Fill rectangles to screen.
    e.Graphics.FillRectangles(blueBrush, rects);
}
Private Sub FillRectanglesRectangleF(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim blueBrush As New SolidBrush(Color.Blue)

    ' Create array of rectangles.
    Dim rects As RectangleF() = {New RectangleF(0.0F, 0.0F, 100.0F, 200.0F), _
    New RectangleF(100.0F, 200.0F, 250.0F, 50.0F), _
    New RectangleF(300.0F, 0.0F, 50.0F, 100.0F)}

    ' Fill rectangles to screen.
    e.Graphics.FillRectangles(blueBrush, rects)
End Sub

적용 대상

FillRectangles(Brush, Rectangle[])

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Rectangle 구조체에 의해 지정된 일련의 사각형의 내부를 채웁니다.

public:
 void FillRectangles(System::Drawing::Brush ^ brush, cli::array <System::Drawing::Rectangle> ^ rects);
public:
 void FillRectangles(System::Drawing::Brush ^ brush, ... cli::array <System::Drawing::Rectangle> ^ rects);
public void FillRectangles (System.Drawing.Brush brush, System.Drawing.Rectangle[] rects);
public void FillRectangles (System.Drawing.Brush brush, params System.Drawing.Rectangle[] rects);
member this.FillRectangles : System.Drawing.Brush * System.Drawing.Rectangle[] -> unit
Public Sub FillRectangles (brush As Brush, rects As Rectangle())
Public Sub FillRectangles (brush As Brush, ParamArray rects As Rectangle())

매개 변수

brush
Brush

채우기의 특징을 결정하는 Brush입니다.

rects
Rectangle[]

채울 사각형을 나타내는 Rectangle 구조체의 배열입니다.

예외

brush이(가) null인 경우

또는

rects이(가) null인 경우

rects이 길이가 0인 배열입니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • 단색 파란색 브러시를 만듭니다.

  • 3개의 사각형 배열을 만듭니다.

  • 화면에 있는 세 개의 사각형 영역을 채웁니다.

public:
   void FillRectanglesRectangle( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ blueBrush = gcnew SolidBrush( Color::Blue );

      // Create array of rectangles.
      array<Rectangle>^ rects = {Rectangle(0,0,100,200),Rectangle(100,200,250,50),Rectangle(300,0,50,100)};

      // Fill rectangles to screen.
      e->Graphics->FillRectangles( blueBrush, rects );
   }
private void FillRectanglesRectangle(PaintEventArgs e)
{

    // Create solid brush.
    SolidBrush blueBrush = new SolidBrush(Color.Blue);

    // Create array of rectangles.
    Rectangle[] rects = { new Rectangle(0, 0, 100, 200), new Rectangle(100, 200, 250, 50), new Rectangle(300, 0, 50, 100) };

    // Fill rectangles to screen.
    e.Graphics.FillRectangles(blueBrush, rects);
}
Private Sub FillRectanglesRectangle(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim blueBrush As New SolidBrush(Color.Blue)

    ' Create array of rectangles.
    Dim rects As Rectangle() = {New Rectangle(0, 0, 100, 200), _
    New Rectangle(100, 200, 250, 50), _
    New Rectangle(300, 0, 50, 100)}

    ' Fill rectangles to screen.
    e.Graphics.FillRectangles(blueBrush, rects)
End Sub

적용 대상