Graphics.IsVisible 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
좌표 쌍에 의해 지정된 점이 이 Graphics의 보이는 클립 영역 안에 포함되었는지 여부를 나타냅니다.
오버로드
IsVisible(Point) | |
IsVisible(PointF) | |
IsVisible(Rectangle) |
Rectangle 구조체에 의해 지정된 사각형이 이 Graphics의 표시된 클립 영역 안에 포함되었는지 여부를 나타냅니다. |
IsVisible(RectangleF) |
RectangleF 구조체에 의해 지정된 사각형이 이 Graphics의 표시된 클립 영역 안에 포함되었는지 여부를 나타냅니다. |
IsVisible(Int32, Int32) |
좌표 쌍에 의해 지정된 점이 이 Graphics의 보이는 클립 영역 안에 포함되었는지 여부를 나타냅니다. |
IsVisible(Single, Single) |
좌표 쌍에 의해 지정된 점이 이 Graphics의 보이는 클립 영역 안에 포함되었는지 여부를 나타냅니다. |
IsVisible(Int32, Int32, Int32, Int32) |
좌표 쌍, 너비 및 높이에 의해 지정된 사각형이 이 Graphics의 보이는 클립 영역 안에 포함되었는지 여부를 나타냅니다. |
IsVisible(Single, Single, Single, Single) |
좌표 쌍, 너비 및 높이에 의해 지정된 사각형이 이 Graphics의 보이는 클립 영역 안에 포함되었는지 여부를 나타냅니다. |
IsVisible(Point)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
public:
bool IsVisible(System::Drawing::Point point);
public bool IsVisible (System.Drawing.Point point);
member this.IsVisible : System.Drawing.Point -> bool
Public Function IsVisible (point As Point) As Boolean
매개 변수
반환
point
매개 변수에 의해 지정된 점이 이 Graphics의 보이는 클립 영역 안에 포함되면 true
이고, 그렇지 않으면 false
입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 다음 작업을 수행합니다.
사각형 클리핑 영역을 만들고 를 사용하여 Replace폼의 그래픽 개체에 대한 클리핑 영역으로 설정합니다.
클리핑 영역 내부에 하나씩, 외부에 하나씩 두 점을 만듭니다.
표시 유형에 대한 각 지점을 테스트하고 표시되는 점만 그립니다.
결과는 클립 영역 내에 있는 하나의 작은 빨간색 원입니다.
public:
void IsVisiblePoint( PaintEventArgs^ e )
{
// Set clip region.
System::Drawing::Region^ clipRegion = gcnew System::Drawing::Region( Rectangle(50,50,100,100) );
e->Graphics->SetClip( clipRegion, CombineMode::Replace );
// Set up coordinates of points.
int x1 = 100;
int y1 = 100;
int x2 = 200;
int y2 = 200;
Point point1 = Point(x1,y1);
Point point2 = Point(x2,y2);
// If point is visible, fill ellipse that represents it.
if ( e->Graphics->IsVisible( point1 ) )
{
e->Graphics->FillEllipse( gcnew SolidBrush( Color::Red ), x1, y1, 10, 10 );
}
if ( e->Graphics->IsVisible( point2 ) )
{
e->Graphics->FillEllipse( gcnew SolidBrush( Color::Blue ), x2, y2, 10, 10 );
}
}
private void IsVisiblePoint(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of points.
int x1 = 100;
int y1 = 100;
int x2 = 200;
int y2 = 200;
Point point1 = new Point(x1, y1);
Point point2 = new Point(x2, y2);
// If point is visible, fill ellipse that represents it.
if (e.Graphics.IsVisible(point1))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Red), x1, y1, 10, 10);
}
if (e.Graphics.IsVisible(point2))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Blue), x2, y2, 10, 10);
}
}
Private Sub IsVisiblePoint(ByVal e As PaintEventArgs)
' Set clip region.
Dim clipRegion As New [Region](New Rectangle(50, 50, 100, 100))
e.Graphics.SetClip(clipRegion, CombineMode.Replace)
' Set up coordinates of points.
Dim x1 As Integer = 100
Dim y1 As Integer = 100
Dim x2 As Integer = 200
Dim y2 As Integer = 200
Dim point1 As New Point(x1, y1)
Dim point2 As New Point(x2, y2)
' If point is visible, fill ellipse that represents it.
If e.Graphics.IsVisible(point1) Then
e.Graphics.FillEllipse(New SolidBrush(Color.Red), x1, y1, _
10, 10)
End If
If e.Graphics.IsVisible(point2) Then
e.Graphics.FillEllipse(New SolidBrush(Color.Blue), x2, y2, _
10, 10)
End If
End Sub
적용 대상
IsVisible(PointF)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
public:
bool IsVisible(System::Drawing::PointF point);
public bool IsVisible (System.Drawing.PointF point);
member this.IsVisible : System.Drawing.PointF -> bool
Public Function IsVisible (point As PointF) As Boolean
매개 변수
반환
point
매개 변수에 의해 지정된 점이 이 Graphics의 보이는 클립 영역 안에 포함되면 true
이고, 그렇지 않으면 false
입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 다음 작업을 수행합니다.
사각형 클리핑 영역을 만들고 를 사용하여 Replace양식의 그래픽에 대한 클리핑 영역으로 설정합니다.
클리핑 영역 내부에 하나씩, 외부에 하나씩 두 점을 만듭니다.
표시 유형에 대한 각 지점을 테스트하고 표시되는 점만 그립니다.
결과는 클립 영역 내에 있는 하나의 작은 빨간색 원입니다.
public:
void IsVisiblePointF( PaintEventArgs^ e )
{
// Set clip region.
System::Drawing::Region^ clipRegion = gcnew System::Drawing::Region( Rectangle(50,50,100,100) );
e->Graphics->SetClip( clipRegion, CombineMode::Replace );
// Set up coordinates of points.
float x1 = 100.0F;
float y1 = 100.0F;
float x2 = 200.0F;
float y2 = 200.0F;
PointF point1 = PointF(x1,y1);
PointF point2 = PointF(x2,y2);
// If point is visible, fill ellipse that represents it.
if ( e->Graphics->IsVisible( point1 ) )
{
e->Graphics->FillEllipse( gcnew SolidBrush( Color::Red ), x1, y1, 10.0F, 10.0F );
}
if ( e->Graphics->IsVisible( point2 ) )
{
e->Graphics->FillEllipse( gcnew SolidBrush( Color::Blue ), x2, y2, 10.0F, 10.0F );
}
}
private void IsVisiblePointF(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of points.
float x1 = 100.0F;
float y1 = 100.0F;
float x2 = 200.0F;
float y2 = 200.0F;
PointF point1 = new PointF(x1, y1);
PointF point2 = new PointF(x2, y2);
// If point is visible, fill ellipse that represents it.
if (e.Graphics.IsVisible(point1))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Red), x1, y1, 10.0F, 10.0F);
}
if (e.Graphics.IsVisible(point2))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Blue), x2, y2, 10.0F, 10.0F);
}
}
Private Sub IsVisiblePointF(ByVal e As PaintEventArgs)
' Set clip region.
Dim clipRegion As New [Region](New Rectangle(50, 50, 100, 100))
e.Graphics.SetClip(clipRegion, CombineMode.Replace)
' Set up coordinates of points.
Dim x1 As Single = 100.0F
Dim y1 As Single = 100.0F
Dim x2 As Single = 200.0F
Dim y2 As Single = 200.0F
Dim point1 As New PointF(x1, y1)
Dim point2 As New PointF(x2, y2)
' If point is visible, fill ellipse that represents it.
If e.Graphics.IsVisible(point1) Then
e.Graphics.FillEllipse(New SolidBrush(Color.Red), x1, y1, _
10.0F, 10.0F)
End If
If e.Graphics.IsVisible(point2) Then
e.Graphics.FillEllipse(New SolidBrush(Color.Blue), x2, y2, _
10.0F, 10.0F)
End If
End Sub
적용 대상
IsVisible(Rectangle)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
public:
bool IsVisible(System::Drawing::Rectangle rect);
public bool IsVisible (System.Drawing.Rectangle rect);
member this.IsVisible : System.Drawing.Rectangle -> bool
Public Function IsVisible (rect As Rectangle) As Boolean
매개 변수
반환
rect
매개 변수에 의해 지정된 사각형이 이 Graphics의 표시된 클립 영역 안에 포함되면 true
이고, 포함되지 않으면 false
입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 다음 작업을 수행합니다.
사각형 클리핑 영역을 만들고 를 사용하여 Replace폼의 그래픽 개체에 대한 클리핑 영역으로 설정합니다.
두 사각형의 위치와 크기를 만듭니다. 하나는 클리핑 영역 내에 있고 다른 하나는 외부에 있습니다.
표시 유형에 대한 각 사각형을 테스트하고 표시되는 사각형만 그립니다.
결과는 클립 영역 내에 있는 하나의 작은 빨간색 사각형입니다.
public:
void IsVisibleRectangle( PaintEventArgs^ e )
{
// Set clip region.
System::Drawing::Region^ clipRegion = gcnew System::Drawing::Region( Rectangle(50,50,100,100) );
e->Graphics->SetClip( clipRegion, CombineMode::Replace );
// Set up coordinates of rectangles.
Rectangle rect1 = Rectangle(100,100,20,20);
Rectangle rect2 = Rectangle(200,200,20,20);
// If rectangle is visible, fill it.
if ( e->Graphics->IsVisible( rect1 ) )
{
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Red ), rect1 );
}
if ( e->Graphics->IsVisible( rect2 ) )
{
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Blue ), rect2 );
}
}
private void IsVisibleRectangle(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of rectangles.
Rectangle rect1 = new Rectangle(100, 100, 20, 20);
Rectangle rect2 = new Rectangle(200, 200, 20, 20);
// If rectangle is visible, fill it.
if (e.Graphics.IsVisible(rect1))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Red), rect1);
}
if (e.Graphics.IsVisible(rect2))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Blue), rect2);
}
}
Private Sub IsVisibleRectangle(ByVal e As PaintEventArgs)
' Set clip region.
Dim clipRegion As New [Region](New Rectangle(50, 50, 100, 100))
e.Graphics.SetClip(clipRegion, CombineMode.Replace)
' Set up coordinates of rectangles.
Dim rect1 As New Rectangle(100, 100, 20, 20)
Dim rect2 As New Rectangle(200, 200, 20, 20)
' If rectangle is visible, fill it.
If e.Graphics.IsVisible(rect1) Then
e.Graphics.FillRectangle(New SolidBrush(Color.Red), rect1)
End If
If e.Graphics.IsVisible(rect2) Then
e.Graphics.FillRectangle(New SolidBrush(Color.Blue), rect2)
End If
End Sub
적용 대상
IsVisible(RectangleF)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
RectangleF 구조체에 의해 지정된 사각형이 이 Graphics의 표시된 클립 영역 안에 포함되었는지 여부를 나타냅니다.
public:
bool IsVisible(System::Drawing::RectangleF rect);
public bool IsVisible (System.Drawing.RectangleF rect);
member this.IsVisible : System.Drawing.RectangleF -> bool
Public Function IsVisible (rect As RectangleF) As Boolean
매개 변수
- rect
- RectangleF
표시 여부를 테스트하는 RectangleF 구조체입니다.
반환
rect
매개 변수에 의해 지정된 사각형이 이 Graphics의 표시된 클립 영역 안에 포함되면 true
이고, 포함되지 않으면 false
입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 다음 작업을 수행합니다.
사각형 클리핑 영역을 만들고 를 사용하여 Replace폼의 그래픽 개체에 대한 클리핑 영역으로 설정합니다.
두 개의 사각형을 만듭니다. 하나는 클리핑 영역 내에 있고 다른 하나는 외부에 있습니다.
표시 유형에 대한 각 사각형을 테스트하고 표시되는 사각형만 그립니다.
결과는 클립 영역 내에 있는 하나의 작은 빨간색 사각형입니다.
public:
void IsVisibleRectangleF( PaintEventArgs^ e )
{
// Set clip region.
System::Drawing::Region^ clipRegion = gcnew System::Drawing::Region( Rectangle(50,50,100,100) );
e->Graphics->SetClip( clipRegion, CombineMode::Replace );
// Set up coordinates of rectangles.
RectangleF rect1 = RectangleF(100.0F,100.0F,20.0F,20.0F);
RectangleF rect2 = RectangleF(200.0F,200.0F,20.0F,20.0F);
// If rectangle is visible, fill it.
if ( e->Graphics->IsVisible( rect1 ) )
{
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Red ), rect1 );
}
if ( e->Graphics->IsVisible( rect2 ) )
{
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Blue ), rect2 );
}
}
private void IsVisibleRectangleF(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of rectangles.
RectangleF rect1 = new RectangleF(100.0F, 100.0F, 20.0F, 20.0F);
RectangleF rect2 = new RectangleF(200.0F, 200.0F, 20.0F, 20.0F);
// If rectangle is visible, fill it.
if (e.Graphics.IsVisible(rect1))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Red), rect1);
}
if (e.Graphics.IsVisible(rect2))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Blue), rect2);
}
}
Private Sub IsVisibleRectangleF(ByVal e As PaintEventArgs)
' Set clip region.
Dim clipRegion As New [Region](New Rectangle(50, 50, 100, 100))
e.Graphics.SetClip(clipRegion, CombineMode.Replace)
' Set up coordinates of rectangles.
Dim rect1 As New RectangleF(100.0F, 100.0F, 20.0F, 20.0F)
Dim rect2 As New RectangleF(200.0F, 200.0F, 20.0F, 20.0F)
' If rectangle is visible, fill it.
If e.Graphics.IsVisible(rect1) Then
e.Graphics.FillRectangle(New SolidBrush(Color.Red), rect1)
End If
If e.Graphics.IsVisible(rect2) Then
e.Graphics.FillRectangle(New SolidBrush(Color.Blue), rect2)
End If
End Sub
적용 대상
IsVisible(Int32, Int32)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
좌표 쌍에 의해 지정된 점이 이 Graphics의 보이는 클립 영역 안에 포함되었는지 여부를 나타냅니다.
public:
bool IsVisible(int x, int y);
public bool IsVisible (int x, int y);
member this.IsVisible : int * int -> bool
Public Function IsVisible (x As Integer, y As Integer) As Boolean
매개 변수
- x
- Int32
표시 여부를 테스트할 점의 X좌표입니다.
- y
- Int32
표시 여부를 테스트할 점의 Y좌표입니다.
반환
x
와 y
매개 변수에 의해 정의된 점이 이 Graphics의 보이는 클립 영역 안에 포함되면 true
이고, 그렇지 않으면 false
입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 다음 작업을 수행합니다.
사각형 클리핑 영역을 만들고 를 사용하여 Replace폼의 그래픽 개체에 대한 클리핑 영역으로 설정합니다.
클리핑 영역 내부에 하나씩, 외부에 하나씩 두 점을 만듭니다.
표시 유형에 대한 각 지점을 테스트하고 표시되는 점만 그립니다.
결과는 클립 영역 내에 있는 하나의 작은 빨간색 원입니다.
public:
void IsVisibleInt( PaintEventArgs^ e )
{
// Set clip region.
System::Drawing::Region^ clipRegion = gcnew System::Drawing::Region( Rectangle(50,50,100,100) );
e->Graphics->SetClip( clipRegion, CombineMode::Replace );
// Set up coordinates of points.
int x1 = 100;
int y1 = 100;
int x2 = 200;
int y2 = 200;
// If point is visible, fill ellipse that represents it.
if ( e->Graphics->IsVisible( x1, y1 ) )
{
e->Graphics->FillEllipse( gcnew SolidBrush( Color::Red ), x1, y1, 10, 10 );
}
if ( e->Graphics->IsVisible( x2, y2 ) )
{
e->Graphics->FillEllipse( gcnew SolidBrush( Color::Blue ), x2, y2, 10, 10 );
}
}
private void IsVisibleInt(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of points.
int x1 = 100;
int y1 = 100;
int x2 = 200;
int y2 = 200;
// If point is visible, fill ellipse that represents it.
if (e.Graphics.IsVisible(x1, y1))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Red), x1, y1, 10, 10);
}
if (e.Graphics.IsVisible(x2, y2))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Blue), x2, y2, 10, 10);
}
}
Private Sub IsVisibleInt(ByVal e As PaintEventArgs)
' Set clip region.
Dim clipRegion As New [Region](New Rectangle(50, 50, 100, 100))
e.Graphics.SetClip(clipRegion, CombineMode.Replace)
' Set up coordinates of points.
Dim x1 As Integer = 100
Dim y1 As Integer = 100
Dim x2 As Integer = 200
Dim y2 As Integer = 200
' If point is visible, fill ellipse that represents it.
If e.Graphics.IsVisible(x1, y1) Then
e.Graphics.FillEllipse(New SolidBrush(Color.Red), x1, y1, _
10, 10)
End If
If e.Graphics.IsVisible(x2, y2) Then
e.Graphics.FillEllipse(New SolidBrush(Color.Blue), x2, y2, _
10, 10)
End If
End Sub
적용 대상
IsVisible(Single, Single)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
좌표 쌍에 의해 지정된 점이 이 Graphics의 보이는 클립 영역 안에 포함되었는지 여부를 나타냅니다.
public:
bool IsVisible(float x, float y);
public bool IsVisible (float x, float y);
member this.IsVisible : single * single -> bool
Public Function IsVisible (x As Single, y As Single) As Boolean
매개 변수
- x
- Single
표시 여부를 테스트할 점의 X좌표입니다.
- y
- Single
표시 여부를 테스트할 점의 Y좌표입니다.
반환
x
와 y
매개 변수에 의해 정의된 점이 이 Graphics의 보이는 클립 영역 안에 포함되면 true
이고, 그렇지 않으면 false
입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 다음 작업을 수행합니다.
사각형 클리핑 영역을 만들고 를 사용하여 Replace폼의 그래픽 개체에 대한 클리핑 영역으로 설정합니다.
클리핑 영역 내부에 하나씩, 외부에 하나씩 두 점을 만듭니다.
표시 유형에 대한 각 지점을 테스트하고 표시되는 점만 그립니다.
결과는 클립 영역 내에 있는 하나의 작은 빨간색 원입니다.
public:
void IsVisibleFloat( PaintEventArgs^ e )
{
// Set clip region.
System::Drawing::Region^ clipRegion = gcnew System::Drawing::Region( Rectangle(50,50,100,100) );
e->Graphics->SetClip( clipRegion, CombineMode::Replace );
// Set up coordinates of points.
float x1 = 100.0F;
float y1 = 100.0F;
float x2 = 200.0F;
float y2 = 200.0F;
// If point is visible, fill ellipse that represents it.
if ( e->Graphics->IsVisible( x1, y1 ) )
{
e->Graphics->FillEllipse( gcnew SolidBrush( Color::Red ), x1, y1, 10.0F, 10.0F );
}
if ( e->Graphics->IsVisible( x2, y2 ) )
{
e->Graphics->FillEllipse( gcnew SolidBrush( Color::Blue ), x2, y2, 10.0F, 10.0F );
}
}
private void IsVisibleFloat(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of points.
float x1 = 100.0F;
float y1 = 100.0F;
float x2 = 200.0F;
float y2 = 200.0F;
// If point is visible, fill ellipse that represents it.
if (e.Graphics.IsVisible(x1, y1))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Red), x1, y1, 10.0F, 10.0F);
}
if (e.Graphics.IsVisible(x2, y2))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Blue), x2, y2, 10.0F, 10.0F);
}
}
Private Sub IsVisibleFloat(ByVal e As PaintEventArgs)
' Set clip region.
Dim clipRegion As New [Region](New Rectangle(50, 50, 100, 100))
e.Graphics.SetClip(clipRegion, CombineMode.Replace)
' Set up coordinates of points.
Dim x1 As Single = 100.0F
Dim y1 As Single = 100.0F
Dim x2 As Single = 200.0F
Dim y2 As Single = 200.0F
' If point is visible, fill ellipse that represents it.
If e.Graphics.IsVisible(x1, y1) Then
e.Graphics.FillEllipse(New SolidBrush(Color.Red), x1, y1, _
10.0F, 10.0F)
End If
If e.Graphics.IsVisible(x2, y2) Then
e.Graphics.FillEllipse(New SolidBrush(Color.Blue), x2, y2, _
10.0F, 10.0F)
End If
End Sub
적용 대상
IsVisible(Int32, Int32, Int32, Int32)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
좌표 쌍, 너비 및 높이에 의해 지정된 사각형이 이 Graphics의 보이는 클립 영역 안에 포함되었는지 여부를 나타냅니다.
public:
bool IsVisible(int x, int y, int width, int height);
public bool IsVisible (int x, int y, int width, int height);
member this.IsVisible : int * int * int * int -> bool
Public Function IsVisible (x As Integer, y As Integer, width As Integer, height As Integer) As Boolean
매개 변수
- x
- Int32
표시 여부를 테스트할 사각형의 왼쪽 위 모퉁이에 대한 X좌표입니다.
- y
- Int32
표시 여부를 테스트할 사각형의 왼쪽 위 모퉁이에 대한 Y좌표입니다.
- width
- Int32
표시 여부를 테스트할 사각형의 너비입니다.
- height
- Int32
표시 여부를 테스트할 사각형의 높이입니다.
반환
x
, y
, width
및 height
매개 변수에 의해 정의된 사각형이 이 Graphics의 보이는 클립 영역 안에 포함되면 true
이고, 그렇지 않으면 false
입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 다음 작업을 수행합니다.
사각형 클리핑 영역을 만들고 를 사용하여 Replace폼의 그래픽 개체에 대한 클리핑 영역으로 설정합니다.
두 사각형의 위치와 크기를 만듭니다. 하나는 클리핑 영역 내에 있고 다른 하나는 외부에 있습니다.
표시 유형에 대한 각 사각형을 테스트하고 표시되는 사각형만 그립니다.
결과는 클립 영역 내에 있는 하나의 작은 빨간색 사각형입니다.
public:
void IsVisible4Int( PaintEventArgs^ e )
{
// Set clip region.
System::Drawing::Region^ clipRegion = gcnew System::Drawing::Region( Rectangle(50,50,100,100) );
e->Graphics->SetClip( clipRegion, CombineMode::Replace );
// Set up coordinates of rectangles.
int x1 = 100;
int y1 = 100;
int width1 = 20;
int height1 = 20;
int x2 = 200;
int y2 = 200;
int width2 = 20;
int height2 = 20;
// If rectangle is visible, fill it.
if ( e->Graphics->IsVisible( x1, y1, width1, height1 ) )
{
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Red ), x1, y1, width1, height1 );
}
if ( e->Graphics->IsVisible( x2, y2, width2, height2 ) )
{
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Blue ), x2, y2, width2, height2 );
}
}
private void IsVisible4Int(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of rectangles.
int x1 = 100;
int y1 = 100;
int width1 = 20;
int height1 = 20;
int x2 = 200;
int y2 = 200;
int width2 = 20;
int height2 = 20;
// If rectangle is visible, fill it.
if (e.Graphics.IsVisible(x1, y1, width1, height1))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Red), x1, y1, width1, height1);
}
if (e.Graphics.IsVisible(x2, y2, width2, height2))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Blue), x2, y2, width2, height2);
}
}
Private Sub IsVisible4Int(ByVal e As PaintEventArgs)
' Set clip region.
Dim clipRegion As New [Region](New Rectangle(50, 50, 100, 100))
e.Graphics.SetClip(clipRegion, CombineMode.Replace)
' Set up coordinates of rectangles.
Dim x1 As Integer = 100
Dim y1 As Integer = 100
Dim width1 As Integer = 20
Dim height1 As Integer = 20
Dim x2 As Integer = 200
Dim y2 As Integer = 200
Dim width2 As Integer = 20
Dim height2 As Integer = 20
' If rectangle is visible, fill it.
If e.Graphics.IsVisible(x1, y1, width1, height1) Then
e.Graphics.FillRectangle(New SolidBrush(Color.Red), x1, y1, _
width1, height1)
End If
If e.Graphics.IsVisible(x2, y2, width2, height2) Then
e.Graphics.FillRectangle(New SolidBrush(Color.Blue), x2, y2, _
width2, height2)
End If
End Sub
적용 대상
IsVisible(Single, Single, Single, Single)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
좌표 쌍, 너비 및 높이에 의해 지정된 사각형이 이 Graphics의 보이는 클립 영역 안에 포함되었는지 여부를 나타냅니다.
public:
bool IsVisible(float x, float y, float width, float height);
public bool IsVisible (float x, float y, float width, float height);
member this.IsVisible : single * single * single * single -> bool
Public Function IsVisible (x As Single, y As Single, width As Single, height As Single) As Boolean
매개 변수
- x
- Single
표시 여부를 테스트할 사각형의 왼쪽 위 모퉁이에 대한 X좌표입니다.
- y
- Single
표시 여부를 테스트할 사각형의 왼쪽 위 모퉁이에 대한 Y좌표입니다.
- width
- Single
표시 여부를 테스트할 사각형의 너비입니다.
- height
- Single
표시 여부를 테스트할 사각형의 높이입니다.
반환
x
, y
, width
및 height
매개 변수에 의해 정의된 사각형이 이 Graphics의 보이는 클립 영역 안에 포함되면 true
이고, 그렇지 않으면 false
입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 다음 작업을 수행합니다.
사각형 클리핑 영역을 만들고 를 사용하여 Replace폼의 그래픽 개체에 대한 클리핑 영역으로 설정합니다.
두 사각형의 위치와 크기를 만듭니다. 하나는 클리핑 영역 내에 있고 다른 하나는 외부에 있습니다.
표시 유형에 대한 각 사각형을 테스트하고 표시되는 사각형만 그립니다.
결과는 클립 영역 내에 있는 하나의 작은 빨간색 사각형입니다.
public:
void IsVisible4Float( PaintEventArgs^ e )
{
// Set clip region.
System::Drawing::Region^ clipRegion = gcnew System::Drawing::Region( Rectangle(50,50,100,100) );
e->Graphics->SetClip( clipRegion, CombineMode::Replace );
// Set up coordinates of rectangles.
float x1 = 100.0F;
float y1 = 100.0F;
float width1 = 20.0F;
float height1 = 20.0F;
float x2 = 200.0F;
float y2 = 200.0F;
float width2 = 20.0F;
float height2 = 20.0F;
// If rectangle is visible, fill it.
if ( e->Graphics->IsVisible( x1, y1, width1, height1 ) )
{
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Red ), x1, y1, width1, height1 );
}
if ( e->Graphics->IsVisible( x2, y2, width2, height2 ) )
{
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Blue ), x2, y2, width2, height2 );
}
}
private void IsVisible4Float(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of rectangles.
float x1 = 100.0F;
float y1 = 100.0F;
float width1 = 20.0F;
float height1 = 20.0F;
float x2 = 200.0F;
float y2 = 200.0F;
float width2 = 20.0F;
float height2 = 20.0F;
// If rectangle is visible, fill it.
if (e.Graphics.IsVisible(x1, y1, width1, height1))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Red), x1, y1, width1, height1);
}
if (e.Graphics.IsVisible(x2, y2, width2, height2))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Blue), x2, y2, width2, height2);
}
}
Private Sub IsVisible4Float(ByVal e As PaintEventArgs)
' Set clip region.
Dim clipRegion As New [Region](New Rectangle(50, 50, 100, 100))
e.Graphics.SetClip(clipRegion, CombineMode.Replace)
' Set up coordinates of rectangles.
Dim x1 As Single = 100.0F
Dim y1 As Single = 100.0F
Dim width1 As Single = 20.0F
Dim height1 As Single = 20.0F
Dim x2 As Single = 200.0F
Dim y2 As Single = 200.0F
Dim width2 As Single = 20.0F
Dim height2 As Single = 20.0F
' If rectangle is visible, fill it.
If e.Graphics.IsVisible(x1, y1, width1, height1) Then
e.Graphics.FillRectangle(New SolidBrush(Color.Red), x1, y1, _
width1, height1)
End If
If e.Graphics.IsVisible(x2, y2, width2, height2) Then
e.Graphics.FillRectangle(New SolidBrush(Color.Blue), x2, y2, _
width2, height2)
End If
End Sub
적용 대상
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기