Region.IsVisible 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
測試指定的矩形是否包含於此 Region。
多載
| 名稱 | Description |
|---|---|
| IsVisible(Single, Single, Single, Single, Graphics) | |
| IsVisible(Int32, Int32, Int32, Int32, Graphics) | |
| IsVisible(Single, Single, Single, Single) |
測試指定矩形中是否有任何部分包含於此 Region。 |
| IsVisible(Int32, Int32, Int32, Int32) |
測試指定矩形中是否有任何部分包含於此 Region。 |
| IsVisible(Single, Single, Graphics) | |
| IsVisible(Int32, Int32, Graphics) | |
| IsVisible(Single, Single) |
測試指定點是否包含於此 Region。 |
| IsVisible(Point) | |
| IsVisible(Rectangle, Graphics) | |
| IsVisible(PointF, Graphics) | |
| IsVisible(Point, Graphics) | |
| IsVisible(RectangleF) |
測試指定 RectangleF 結構的任何部分是否包含於此 Region。 |
| IsVisible(Rectangle) | |
| IsVisible(PointF) | |
| IsVisible(RectangleF, Graphics) |
測試在使用指定 RectangleF繪製時,指定結構的任何部分Region是否包含於此中Graphics。 |
IsVisible(Single, Single, Single, Single, Graphics)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
public:
bool IsVisible(float x, float y, float width, float height, System::Drawing::Graphics ^ g);
public bool IsVisible(float x, float y, float width, float height, System.Drawing.Graphics? g);
public bool IsVisible(float x, float y, float width, float height, System.Drawing.Graphics g);
member this.IsVisible : single * single * single * single * System.Drawing.Graphics -> bool
Public Function IsVisible (x As Single, y As Single, width As Single, height As Single, g As Graphics) As Boolean
參數
- x
- Single
要測試的矩形左上角的 x 座標。
- y
- Single
測試矩形左上角的 y 座標。
- width
- Single
要測試的是矩形的寬度。
- height
- Single
要測試的是矩形的高度。
傳回
true當指定矩形的任一部分包含於此Region;否則,。 false
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
備註
圖形上下文的當前轉換用於計算繪圖表面上的區域內部座標與矩形座標。
適用於
IsVisible(Int32, Int32, Int32, Int32, Graphics)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
public:
bool IsVisible(int x, int y, int width, int height, System::Drawing::Graphics ^ g);
public bool IsVisible(int x, int y, int width, int height, System.Drawing.Graphics? g);
public bool IsVisible(int x, int y, int width, int height, System.Drawing.Graphics g);
member this.IsVisible : int * int * int * int * System.Drawing.Graphics -> bool
Public Function IsVisible (x As Integer, y As Integer, width As Integer, height As Integer, g As Graphics) As Boolean
參數
- x
- Int32
要測試的矩形左上角的 x 座標。
- y
- Int32
測試矩形左上角的 y 座標。
- width
- Int32
要測試的是矩形的寬度。
- height
- Int32
要測試的是矩形的高度。
傳回
true當指定矩形的任一部分包含於此Region;否則,。 false
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
備註
圖形上下文的當前轉換用於計算繪圖表面上的區域內部座標與矩形座標。
適用於
IsVisible(Single, Single, Single, Single)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
測試指定矩形中是否有任何部分包含於此 Region。
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
要測試的是矩形的高度。
傳回
true 當指定矩形的任一部分包含在這個 Region 物件中時;否則, false。
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
適用於
IsVisible(Int32, Int32, Int32, Int32)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
測試指定矩形中是否有任何部分包含於此 Region。
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
要測試的是矩形的高度。
傳回
true當指定矩形的任一部分包含於此Region;否則,。 false
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
適用於
IsVisible(Single, Single, Graphics)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
public:
bool IsVisible(float x, float y, System::Drawing::Graphics ^ g);
public bool IsVisible(float x, float y, System.Drawing.Graphics? g);
public bool IsVisible(float x, float y, System.Drawing.Graphics g);
member this.IsVisible : single * single * System.Drawing.Graphics -> bool
Public Function IsVisible (x As Single, y As Single, g As Graphics) As Boolean
參數
- x
- Single
要測點的 x 座標。
- y
- Single
測試點的 y 座標。
傳回
true當指定點包含於此Region;否則,。 false
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
備註
圖形上下文的當前轉換用來計算繪圖表面上的區域內部與點座標。
適用於
IsVisible(Int32, Int32, Graphics)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
public:
bool IsVisible(int x, int y, System::Drawing::Graphics ^ g);
public bool IsVisible(int x, int y, System.Drawing.Graphics? g);
public bool IsVisible(int x, int y, System.Drawing.Graphics g);
member this.IsVisible : int * int * System.Drawing.Graphics -> bool
Public Function IsVisible (x As Integer, y As Integer, g As Graphics) As Boolean
參數
- x
- Int32
要測點的 x 座標。
- y
- Int32
測試點的 y 座標。
傳回
true當指定點包含於此Region;否則,。 false
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
備註
圖形上下文的當前轉換用來計算繪圖表面上的區域內部與點座標。
適用於
IsVisible(Single, Single)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
測試指定點是否包含於此 Region。
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 座標。
傳回
true當指定點包含於此Region;否則,。 false
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
適用於
IsVisible(Point)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.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
參數
傳回
true當 point 包含於此 Region;否則,。 false
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
適用於
IsVisible(Rectangle, Graphics)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
public:
bool IsVisible(System::Drawing::Rectangle rect, System::Drawing::Graphics ^ g);
public bool IsVisible(System.Drawing.Rectangle rect, System.Drawing.Graphics? g);
public bool IsVisible(System.Drawing.Rectangle rect, System.Drawing.Graphics g);
member this.IsVisible : System.Drawing.Rectangle * System.Drawing.Graphics -> bool
Public Function IsVisible (rect As Rectangle, g As Graphics) As Boolean
參數
傳回
true 當 的 rect 任一部分包含在 Region中;否則, false。
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
備註
圖形上下文的當前轉換用於計算繪圖表面上的區域內部座標與矩形座標。
適用於
IsVisible(PointF, Graphics)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
public:
bool IsVisible(System::Drawing::PointF point, System::Drawing::Graphics ^ g);
public bool IsVisible(System.Drawing.PointF point, System.Drawing.Graphics? g);
public bool IsVisible(System.Drawing.PointF point, System.Drawing.Graphics g);
member this.IsVisible : System.Drawing.PointF * System.Drawing.Graphics -> bool
Public Function IsVisible (point As PointF, g As Graphics) As Boolean
參數
傳回
true當 point 包含於此 Region;否則,。 false
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
備註
圖形上下文的當前轉換用來計算繪圖表面上的區域內部與點座標。
適用於
IsVisible(Point, Graphics)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
public:
bool IsVisible(System::Drawing::Point point, System::Drawing::Graphics ^ g);
public bool IsVisible(System.Drawing.Point point, System.Drawing.Graphics? g);
public bool IsVisible(System.Drawing.Point point, System.Drawing.Graphics g);
member this.IsVisible : System.Drawing.Point * System.Drawing.Graphics -> bool
Public Function IsVisible (point As Point, g As Graphics) As Boolean
參數
傳回
true當 point 包含於此 Region;否則,。 false
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
備註
圖形上下文的當前轉換用來計算繪圖表面上的區域內部與點座標。
適用於
IsVisible(RectangleF)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
測試指定 RectangleF 結構的任何部分是否包含於此 Region。
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 結構。
傳回
true當 的rect任一部分包含在此Region中;否則,。 false
範例
以下程式碼範例是為 Windows Forms 設計的,並需要 PaintEventArgse,這是 Paint 事件處理程序的參數。 此程式碼會執行下列動作:
建立第一個矩形並以藍色繪製到螢幕上。
建立第二個矩形,並以紅色畫到螢幕上。
從第一個矩形建立一個區域。
判斷矩形是否有部分與該區域相交。
在螢幕上顯示
true結果false。
注意矩形與該區域相交,因此結果為 true。
public:
void IsVisible_RectF_Example( PaintEventArgs^ e )
{
// Create the first rectangle and draw it to the screen in blue.
Rectangle regionRect = Rectangle(20,20,100,100);
e->Graphics->DrawRectangle( Pens::Blue, regionRect );
// Create the second rectangle and draw it to the screen in red.
RectangleF myRect = RectangleF(90,30,100,100);
e->Graphics->DrawRectangle( Pens::Red, Rectangle::Round( myRect ) );
// Create a region using the first rectangle.
System::Drawing::Region^ myRegion = gcnew System::Drawing::Region( regionRect );
// Determine if myRect is contained in the region.
bool contained = myRegion->IsVisible( myRect );
// Display the result.
System::Drawing::Font^ myFont = gcnew System::Drawing::Font( "Arial",8 );
SolidBrush^ myBrush = gcnew SolidBrush( Color::Black );
e->Graphics->DrawString( String::Format( "contained = {0}", contained ), myFont, myBrush, PointF(20,140) );
}
public void IsVisible_RectF_Example(PaintEventArgs e)
{
// Create the first rectangle and draw it to the screen in blue.
Rectangle regionRect = new Rectangle(20, 20, 100, 100);
e.Graphics.DrawRectangle(Pens.Blue, regionRect);
// Create the second rectangle and draw it to the screen in red.
RectangleF myRect = new RectangleF(90, 30, 100, 100);
e.Graphics.DrawRectangle(Pens.Red, Rectangle.Round(myRect));
// Create a region using the first rectangle.
Region myRegion = new Region(regionRect);
// Determine if myRect is contained in the region.
bool contained = myRegion.IsVisible(myRect);
// Display the result.
Font myFont = new Font("Arial", 8);
SolidBrush myBrush = new SolidBrush(Color.Black);
e.Graphics.DrawString("contained = " + contained.ToString(),
myFont,
myBrush,
new PointF(20, 140));
}
Public Sub IsVisible_RectF_Example(ByVal e As PaintEventArgs)
' Create the first rectangle and draw it to the screen in blue.
Dim regionRect As New Rectangle(20, 20, 100, 100)
e.Graphics.DrawRectangle(Pens.Blue, regionRect)
' create the second rectangle and draw it to the screen in red.
Dim myRect As New RectangleF(90, 30, 100, 100)
e.Graphics.DrawRectangle(Pens.Red, Rectangle.Round(myRect))
' Create a region using the first rectangle.
Dim myRegion As New [Region](regionRect)
' Determine if myRect is contained in the region.
Dim contained As Boolean = myRegion.IsVisible(myRect)
' Display the result.
Dim myFont As New Font("Arial", 8)
Dim myBrush As New SolidBrush(Color.Black)
e.Graphics.DrawString("contained = " & contained.ToString(), _
myFont, myBrush, New PointF(20, 140))
End Sub
適用於
IsVisible(Rectangle)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.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
參數
傳回
當 的true任一部分包含於此 rect;否則,該Region方法返回 false 。
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
適用於
IsVisible(PointF)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.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
參數
傳回
true當 point 包含於此 Region;否則,。 false
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
適用於
IsVisible(RectangleF, Graphics)
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
- 來源:
- Region.cs
測試在使用指定 RectangleF繪製時,指定結構的任何部分Region是否包含於此中Graphics。
public:
bool IsVisible(System::Drawing::RectangleF rect, System::Drawing::Graphics ^ g);
public bool IsVisible(System.Drawing.RectangleF rect, System.Drawing.Graphics? g);
public bool IsVisible(System.Drawing.RectangleF rect, System.Drawing.Graphics g);
member this.IsVisible : System.Drawing.RectangleF * System.Drawing.Graphics -> bool
Public Function IsVisible (rect As RectangleF, g As Graphics) As Boolean
參數
- rect
- RectangleF
要測試的 RectangleF 結構。
傳回
true當 rect 包含於此 Region;否則,。 false
範例
程式碼範例請參見該 IsVisible(RectangleF) 方法。
備註
圖形上下文的當前轉換用於計算繪圖表面上的區域內部座標與矩形座標。