Graphics.FillRectangle 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
한 쌍의 좌표, 너비 및 높이로 지정된 사각형의 내부를 채웁니다.
오버로드
| FillRectangle(Brush, Rectangle) |
Rectangle 구조체로 지정된 사각형의 내부를 채웁니다. |
| FillRectangle(Brush, RectangleF) |
RectangleF 구조체로 지정된 사각형의 내부를 채웁니다. |
| FillRectangle(Brush, Int32, Int32, Int32, Int32) |
한 쌍의 좌표, 너비 및 높이로 지정된 사각형의 내부를 채웁니다. |
| FillRectangle(Brush, Single, Single, Single, Single) |
한 쌍의 좌표, 너비 및 높이로 지정된 사각형의 내부를 채웁니다. |
FillRectangle(Brush, Rectangle)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
Rectangle 구조체로 지정된 사각형의 내부를 채웁니다.
public:
void FillRectangle(System::Drawing::Brush ^ brush, System::Drawing::Rectangle rect);
public void FillRectangle(System.Drawing.Brush brush, System.Drawing.Rectangle rect);
member this.FillRectangle : System.Drawing.Brush * System.Drawing.Rectangle -> unit
Public Sub FillRectangle (brush As Brush, rect As Rectangle)
매개 변수
예외
brush
null.
예제
다음 코드 예제는 Windows Forms에서 사용하도록 설계되었으며 Paint 이벤트 처리기의 매개 변수인 PaintEventArgse필요합니다. 코드는 다음 작업을 수행합니다.
단색 파란색 브러시를 만듭니다.
사각형을 만듭니다.
화면의 사각형 영역을 채웁니다.
public:
void FillRectangleRectangle( PaintEventArgs^ e )
{
// Create solid brush.
SolidBrush^ blueBrush = gcnew SolidBrush( Color::Blue );
// Create rectangle.
Rectangle rect = Rectangle(0,0,200,200);
// Fill rectangle to screen.
e->Graphics->FillRectangle( blueBrush, rect );
}
private void FillRectangleRectangle(PaintEventArgs e)
{
// Create solid brush.
SolidBrush blueBrush = new SolidBrush(Color.Blue);
// Create rectangle.
Rectangle rect = new Rectangle(0, 0, 200, 200);
// Fill rectangle to screen.
e.Graphics.FillRectangle(blueBrush, rect);
}
Private Sub FillRectangleRectangle(ByVal e As PaintEventArgs)
' Create solid brush.
Dim blueBrush As New SolidBrush(Color.Blue)
' Create rectangle.
Dim rect As New Rectangle(0, 0, 200, 200)
' Fill rectangle to screen.
e.Graphics.FillRectangle(blueBrush, rect)
End Sub
설명
이 메서드는 지정된 왼쪽 위 모서리와 계산된 아래쪽 가장자리까지 포함하여 rect 매개 변수로 정의된 사각형의 내부를 채웁니다.
적용 대상
FillRectangle(Brush, RectangleF)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
RectangleF 구조체로 지정된 사각형의 내부를 채웁니다.
public:
void FillRectangle(System::Drawing::Brush ^ brush, System::Drawing::RectangleF rect);
public void FillRectangle(System.Drawing.Brush brush, System.Drawing.RectangleF rect);
member this.FillRectangle : System.Drawing.Brush * System.Drawing.RectangleF -> unit
Public Sub FillRectangle (brush As Brush, rect As RectangleF)
매개 변수
- rect
- RectangleF
채울 사각형을 나타내는 RectangleF 구조체입니다.
예외
brush
null.
예제
다음 코드 예제는 Windows Forms에서 사용하도록 설계되었으며 Paint 이벤트 처리기의 매개 변수인 PaintEventArgse필요합니다. 코드는 다음 작업을 수행합니다.
단색 파란색 브러시를 만듭니다.
사각형을 만듭니다.
화면의 사각형 영역을 채웁니다.
public:
void FillRectangleRectangleF( PaintEventArgs^ e )
{
// Create solid brush.
SolidBrush^ blueBrush = gcnew SolidBrush( Color::Blue );
// Create rectangle.
RectangleF rect = RectangleF(0.0F,0.0F,200.0F,200.0F);
// Fill rectangle to screen.
e->Graphics->FillRectangle( blueBrush, rect );
}
private void FillRectangleRectangleF(PaintEventArgs e)
{
// Create solid brush.
SolidBrush blueBrush = new SolidBrush(Color.Blue);
// Create rectangle.
RectangleF rect = new RectangleF(0.0F, 0.0F, 200.0F, 200.0F);
// Fill rectangle to screen.
e.Graphics.FillRectangle(blueBrush, rect);
}
Private Sub FillRectangleRectangleF(ByVal e As PaintEventArgs)
' Create solid brush.
Dim blueBrush As New SolidBrush(Color.Blue)
' Create rectangle.
Dim rect As New RectangleF(0.0F, 0.0F, 200.0F, 200.0F)
' Fill rectangle to screen.
e.Graphics.FillRectangle(blueBrush, rect)
End Sub
설명
이 메서드는 지정된 왼쪽 위 모서리와 계산된 아래쪽 가장자리까지 포함하여 rect 매개 변수로 정의된 사각형의 내부를 채웁니다.
적용 대상
FillRectangle(Brush, Int32, Int32, Int32, Int32)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
한 쌍의 좌표, 너비 및 높이로 지정된 사각형의 내부를 채웁니다.
public:
void FillRectangle(System::Drawing::Brush ^ brush, int x, int y, int width, int height);
public void FillRectangle(System.Drawing.Brush brush, int x, int y, int width, int height);
member this.FillRectangle : System.Drawing.Brush * int * int * int * int -> unit
Public Sub FillRectangle (brush As Brush, x As Integer, y As Integer, width As Integer, height As Integer)
매개 변수
- x
- Int32
채울 사각형의 왼쪽 위 모퉁이의 x 좌표입니다.
- y
- Int32
채울 사각형의 왼쪽 위 모퉁이에 대한 y 좌표입니다.
- width
- Int32
채울 사각형의 너비입니다.
- height
- Int32
채울 사각형의 높이입니다.
예외
brush
null.
예제
다음 코드 예제는 Windows Forms에서 사용하도록 설계되었으며 Paint 이벤트 처리기의 매개 변수인 PaintEventArgse필요합니다. 코드는 다음 작업을 수행합니다.
단색 파란색 브러시를 만듭니다.
사각형의 위치와 크기를 만듭니다.
화면의 사각형 영역을 채웁니다.
public:
void FillRectangleInt( PaintEventArgs^ e )
{
// Create solid brush.
SolidBrush^ blueBrush = gcnew SolidBrush( Color::Blue );
// Create location and size of rectangle.
int x = 0;
int y = 0;
int width = 200;
int height = 200;
// Fill rectangle to screen.
e->Graphics->FillRectangle( blueBrush, x, y, width, height );
}
private void FillRectangleInt(PaintEventArgs e)
{
// Create solid brush.
SolidBrush blueBrush = new SolidBrush(Color.Blue);
// Create location and size of rectangle.
int x = 0;
int y = 0;
int width = 200;
int height = 200;
// Fill rectangle to screen.
e.Graphics.FillRectangle(blueBrush, x, y, width, height);
}
Private Sub FillRectangleInt(ByVal e As PaintEventArgs)
' Create solid brush.
Dim blueBrush As New SolidBrush(Color.Blue)
' Create location and size of rectangle.
Dim x As Integer = 0
Dim y As Integer = 0
Dim width As Integer = 200
Dim height As Integer = 200
' Fill rectangle to screen.
e.Graphics.FillRectangle(blueBrush, x, y, width, height)
End Sub
설명
이 메서드는 지정된 왼쪽 위 모서리와 계산된 아래쪽 가장자리까지x, y, width및 height 매개 변수로 정의된 사각형의 내부를 채웁니다.
적용 대상
FillRectangle(Brush, Single, Single, Single, Single)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
한 쌍의 좌표, 너비 및 높이로 지정된 사각형의 내부를 채웁니다.
public:
void FillRectangle(System::Drawing::Brush ^ brush, float x, float y, float width, float height);
public void FillRectangle(System.Drawing.Brush brush, float x, float y, float width, float height);
member this.FillRectangle : System.Drawing.Brush * single * single * single * single -> unit
Public Sub FillRectangle (brush As Brush, x As Single, y As Single, width As Single, height As Single)
매개 변수
- x
- Single
채울 사각형의 왼쪽 위 모퉁이의 x 좌표입니다.
- y
- Single
채울 사각형의 왼쪽 위 모퉁이에 대한 y 좌표입니다.
- width
- Single
채울 사각형의 너비입니다.
- height
- Single
채울 사각형의 높이입니다.
예외
brush
null.
예제
다음 코드 예제는 Windows Forms에서 사용하도록 설계되었으며 Paint 이벤트 처리기의 매개 변수인 PaintEventArgse필요합니다. 코드는 다음 작업을 수행합니다.
단색 파란색 브러시를 만듭니다.
사각형의 위치와 크기를 만듭니다.
화면의 사각형 영역을 채웁니다.
public:
void FillRectangleFloat( PaintEventArgs^ e )
{
// Create solid brush.
SolidBrush^ blueBrush = gcnew SolidBrush( Color::Blue );
// Create location and size of rectangle.
float x = 0.0F;
float y = 0.0F;
float width = 200.0F;
float height = 200.0F;
// Fill rectangle to screen.
e->Graphics->FillRectangle( blueBrush, x, y, width, height );
}
private void FillRectangleFloat(PaintEventArgs e)
{
// Create solid brush.
SolidBrush blueBrush = new SolidBrush(Color.Blue);
// Create location and size of rectangle.
float x = 0.0F;
float y = 0.0F;
float width = 200.0F;
float height = 200.0F;
// Fill rectangle to screen.
e.Graphics.FillRectangle(blueBrush, x, y, width, height);
}
Private Sub FillRectangleFloat(ByVal e As PaintEventArgs)
' Create solid brush.
Dim blueBrush As New SolidBrush(Color.Blue)
' Create location and size of rectangle.
Dim x As Single = 0.0F
Dim y As Single = 0.0F
Dim width As Single = 200.0F
Dim height As Single = 200.0F
' Fill rectangle to screen.
e.Graphics.FillRectangle(blueBrush, x, y, width, height)
End Sub
설명
이 메서드는 지정된 왼쪽 위 모서리와 계산된 아래쪽 가장자리까지 x, y, width및 height 매개 변수로 정의된 사각형의 내부를 채웁니다.