GraphicsPath.IsOutlineVisible 方法

定義

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。

多載

IsOutlineVisible(Int32, Int32, Pen, Graphics)

指出當使用指定的 GraphicsPath 和指定的 Pen 繪製時,指定的點是否包含在這個 Graphics 的外框內 (下面)。

IsOutlineVisible(Point, Pen, Graphics)

指出當使用指定的 GraphicsPath 和指定的 Pen 繪製時,指定的點是否包含在這個 Graphics 的外框內 (下面)。

IsOutlineVisible(Single, Single, Pen, Graphics)

指出當使用指定的 GraphicsPath 和指定的 Pen 繪製時,指定的點是否包含在這個 Graphics 的外框內 (下面)。

IsOutlineVisible(Single, Single, Pen)

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。

IsOutlineVisible(PointF, Pen)

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。

IsOutlineVisible(PointF, Pen, Graphics)

指出當使用指定的 GraphicsPath 和指定的 Pen 繪製時,指定的點是否包含在這個 Graphics 的外框內 (下面)。

IsOutlineVisible(Int32, Int32, Pen)

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。

IsOutlineVisible(Point, Pen)

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。

IsOutlineVisible(Int32, Int32, Pen, Graphics)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs

指出當使用指定的 GraphicsPath 和指定的 Pen 繪製時,指定的點是否包含在這個 Graphics 的外框內 (下面)。

public:
 bool IsOutlineVisible(int x, int y, System::Drawing::Pen ^ pen, System::Drawing::Graphics ^ graphics);
public bool IsOutlineVisible (int x, int y, System.Drawing.Pen pen, System.Drawing.Graphics graphics);
public bool IsOutlineVisible (int x, int y, System.Drawing.Pen pen, System.Drawing.Graphics? graphics);
member this.IsOutlineVisible : int * int * System.Drawing.Pen * System.Drawing.Graphics -> bool
Public Function IsOutlineVisible (x As Integer, y As Integer, pen As Pen, graphics As Graphics) As Boolean

參數

x
Int32

要測試的點的 X 座標。

y
Int32

要測試的點的 Y 座標。

pen
Pen

要測試的 Pen

graphics
Graphics

用以測試可視性的 Graphics

傳回

當使用指定的 GraphicsPath 繪製時,如果這個 Pen 的外框內包含指定的點,則這個方法會傳回 true,否則傳回 false

範例

下列程式代碼範例是設計來搭配 Windows Forms 使用,而且需要 PaintEventArgse事件OnPaint。 此程式碼會執行下列動作:

  • 建立路徑。

  • 將矩形新增至路徑。

  • 建立寬筆並使用該畫筆擴展路徑 (,讓範例更清楚) ,

  • 測試點 (100,50) ,以查看它是否位於矩形的其中一個邊緣 IsOutlineVisible底下) (。

在此案例中,結果會顯示在消息框中 (true) 。 換句話說,邊緣會轉譯到該點上。

public:
   void IsOutlineVisibleExample( PaintEventArgs^ e )
   {
      GraphicsPath^ myPath = gcnew GraphicsPath;
      Rectangle rect = Rectangle(20,20,100,100);
      myPath->AddRectangle( rect );
      Pen^ testPen = gcnew Pen( Color::Black,20.0f );
      myPath->Widen( testPen );
      e->Graphics->FillPath( Brushes::Black, myPath );
      bool visible = myPath->IsOutlineVisible( 100, 50, testPen, e->Graphics );
      MessageBox::Show( String::Format( "visible = {0}", visible ) );
   }
public void IsOutlineVisibleExample(PaintEventArgs e)
{
    GraphicsPath myPath = new GraphicsPath();
    Rectangle rect = new Rectangle(20, 20, 100, 100);
    myPath.AddRectangle(rect);
    Pen testPen = new Pen(Color.Black, 20);
    myPath.Widen(testPen);
    e.Graphics.FillPath(Brushes.Black, myPath);
    bool visible = myPath.IsOutlineVisible(100, 50, testPen,
        e.Graphics);
    MessageBox.Show("visible = " + visible.ToString());
}
Public Sub IsOutlineVisibleExample(ByVal e As PaintEventArgs)
    Dim myPath As New GraphicsPath
    Dim rect As New Rectangle(20, 20, 100, 100)
    myPath.AddRectangle(rect)
    Dim testPen As New Pen(Color.Black, 20)
    myPath.Widen(testPen)
    e.Graphics.FillPath(Brushes.Black, myPath)
    Dim visible As Boolean = myPath.IsOutlineVisible(100, 50, _
    testPen, e.Graphics)
    MessageBox.Show(("visible = " + visible.ToString()))
End Sub

備註

這個方法會測試,以查看指定路徑的外框是否顯示在指定的點上。 要測試之點的座標會以世界座標提供。 的轉換矩陣 graphics 會在測試可見度之前暫時套用。

適用於

IsOutlineVisible(Point, Pen, Graphics)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs

指出當使用指定的 GraphicsPath 和指定的 Pen 繪製時,指定的點是否包含在這個 Graphics 的外框內 (下面)。

public:
 bool IsOutlineVisible(System::Drawing::Point pt, System::Drawing::Pen ^ pen, System::Drawing::Graphics ^ graphics);
public bool IsOutlineVisible (System.Drawing.Point pt, System.Drawing.Pen pen, System.Drawing.Graphics graphics);
public bool IsOutlineVisible (System.Drawing.Point pt, System.Drawing.Pen pen, System.Drawing.Graphics? graphics);
member this.IsOutlineVisible : System.Drawing.Point * System.Drawing.Pen * System.Drawing.Graphics -> bool
Public Function IsOutlineVisible (pt As Point, pen As Pen, graphics As Graphics) As Boolean

參數

pt
Point

Point,指定要測試的位置。

pen
Pen

要測試的 Pen

graphics
Graphics

用以測試可視性的 Graphics

傳回

當使用指定的 GraphicsPath 繪製時,如果這個 Pen 的外框內包含指定的點,則這個方法會傳回 true,否則傳回 false

範例

如需範例,請參閱 IsOutlineVisible(Int32, Int32, Pen, Graphics)

備註

這個方法會測試,以查看指定路徑的外框是否顯示在指定的點上。 要測試之點的座標會以世界座標提供。 的轉換矩陣 graphics 會在測試可見度之前暫時套用。

適用於

IsOutlineVisible(Single, Single, Pen, Graphics)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs

指出當使用指定的 GraphicsPath 和指定的 Pen 繪製時,指定的點是否包含在這個 Graphics 的外框內 (下面)。

public:
 bool IsOutlineVisible(float x, float y, System::Drawing::Pen ^ pen, System::Drawing::Graphics ^ graphics);
public bool IsOutlineVisible (float x, float y, System.Drawing.Pen pen, System.Drawing.Graphics graphics);
public bool IsOutlineVisible (float x, float y, System.Drawing.Pen pen, System.Drawing.Graphics? graphics);
member this.IsOutlineVisible : single * single * System.Drawing.Pen * System.Drawing.Graphics -> bool
Public Function IsOutlineVisible (x As Single, y As Single, pen As Pen, graphics As Graphics) As Boolean

參數

x
Single

要測試的點的 X 座標。

y
Single

要測試的點的 Y 座標。

pen
Pen

要測試的 Pen

graphics
Graphics

用以測試可視性的 Graphics

傳回

當使用指定的 GraphicsPath 繪製時,如果這個 Pen 的外框之內 (或之下) 包含指定的點,則這個方法會傳回 true,否則傳回 false

範例

如需範例,請參閱 IsOutlineVisible(Int32, Int32, Pen, Graphics)

備註

這個方法會測試,以查看指定路徑的外框是否顯示在指定的點上。 要測試之點的座標會以世界座標提供。 參數的 graphics 轉換矩陣會在測試可見度之前暫時套用。

適用於

IsOutlineVisible(Single, Single, Pen)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。

public:
 bool IsOutlineVisible(float x, float y, System::Drawing::Pen ^ pen);
public bool IsOutlineVisible (float x, float y, System.Drawing.Pen pen);
member this.IsOutlineVisible : single * single * System.Drawing.Pen -> bool
Public Function IsOutlineVisible (x As Single, y As Single, pen As Pen) As Boolean

參數

x
Single

要測試的點的 X 座標。

y
Single

要測試的點的 Y 座標。

pen
Pen

要測試的 Pen

傳回

當使用指定的 GraphicsPath 繪製時,如果指定的點包含在這個 Pen 的外框內,則這個方法會傳回 true,否則為 false

範例

如需範例,請參閱 IsOutlineVisible(Int32, Int32, Pen, Graphics)

備註

這個方法會測試,以查看指定路徑的外框是否顯示在指定的點上。

適用於

IsOutlineVisible(PointF, Pen)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。

public:
 bool IsOutlineVisible(System::Drawing::PointF point, System::Drawing::Pen ^ pen);
public bool IsOutlineVisible (System.Drawing.PointF point, System.Drawing.Pen pen);
member this.IsOutlineVisible : System.Drawing.PointF * System.Drawing.Pen -> bool
Public Function IsOutlineVisible (point As PointF, pen As Pen) As Boolean

參數

point
PointF

PointF,指定要測試的位置。

pen
Pen

要測試的 Pen

傳回

當使用指定的 GraphicsPath 繪製時,如果指定的點包含在這個 Pen 的外框內,則這個方法會傳回 true,否則為 false

範例

如需範例,請參閱 IsOutlineVisible(Int32, Int32, Pen, Graphics)

備註

這個方法會測試,以查看指定路徑的外框是否顯示在指定的點上。

適用於

IsOutlineVisible(PointF, Pen, Graphics)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs

指出當使用指定的 GraphicsPath 和指定的 Pen 繪製時,指定的點是否包含在這個 Graphics 的外框內 (下面)。

public:
 bool IsOutlineVisible(System::Drawing::PointF pt, System::Drawing::Pen ^ pen, System::Drawing::Graphics ^ graphics);
public bool IsOutlineVisible (System.Drawing.PointF pt, System.Drawing.Pen pen, System.Drawing.Graphics graphics);
public bool IsOutlineVisible (System.Drawing.PointF pt, System.Drawing.Pen pen, System.Drawing.Graphics? graphics);
member this.IsOutlineVisible : System.Drawing.PointF * System.Drawing.Pen * System.Drawing.Graphics -> bool
Public Function IsOutlineVisible (pt As PointF, pen As Pen, graphics As Graphics) As Boolean

參數

pt
PointF

PointF,指定要測試的位置。

pen
Pen

要測試的 Pen

graphics
Graphics

用以測試可視性的 Graphics

傳回

當使用指定的 GraphicsPath 繪製時,如果這個 Pen 的外框之內 (或之下) 包含指定的點,則這個方法會傳回 true,否則傳回 false

範例

如需範例,請參閱 IsOutlineVisible(Int32, Int32, Pen, Graphics)

備註

這個方法會測試,以查看指定路徑的外框是否顯示在指定的點上。 要測試之點的座標會以世界座標提供。 的轉換矩陣 graphics 會在測試可見度之前暫時套用。

適用於

IsOutlineVisible(Int32, Int32, Pen)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。

public:
 bool IsOutlineVisible(int x, int y, System::Drawing::Pen ^ pen);
public bool IsOutlineVisible (int x, int y, System.Drawing.Pen pen);
member this.IsOutlineVisible : int * int * System.Drawing.Pen -> bool
Public Function IsOutlineVisible (x As Integer, y As Integer, pen As Pen) As Boolean

參數

x
Int32

要測試的點的 X 座標。

y
Int32

要測試的點的 Y 座標。

pen
Pen

要測試的 Pen

傳回

當使用指定的 GraphicsPath 繪製時,如果指定的點包含在這個 Pen 的外框內,則這個方法會傳回 true,否則為 false

範例

如需範例,請參閱 IsOutlineVisible(Int32, Int32, Pen, Graphics)

備註

這個方法會測試,以查看指定路徑的外框是否顯示在指定的點上。

適用於

IsOutlineVisible(Point, Pen)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。

public:
 bool IsOutlineVisible(System::Drawing::Point point, System::Drawing::Pen ^ pen);
public bool IsOutlineVisible (System.Drawing.Point point, System.Drawing.Pen pen);
member this.IsOutlineVisible : System.Drawing.Point * System.Drawing.Pen -> bool
Public Function IsOutlineVisible (point As Point, pen As Pen) As Boolean

參數

point
Point

Point,指定要測試的位置。

pen
Pen

要測試的 Pen

傳回

當使用指定的 GraphicsPath 繪製時,如果指定的點包含在這個 Pen 的外框內,則這個方法會傳回 true,否則為 false

範例

如需範例,請參閱 IsOutlineVisible(Int32, Int32, Pen, Graphics)

備註

這個方法會測試,以查看指定路徑的外框是否顯示在指定的點上。

適用於