Edit

Share via


GraphicsPath.IsOutlineVisible Method

Definition

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.

Overloads

IsOutlineVisible(Int32, Int32, Pen, Graphics)

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.

IsOutlineVisible(Point, Pen, Graphics)

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.

IsOutlineVisible(Single, Single, Pen, Graphics)

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.

IsOutlineVisible(Single, Single, Pen)

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.

IsOutlineVisible(PointF, Pen)

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.

IsOutlineVisible(PointF, Pen, Graphics)

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.

IsOutlineVisible(Int32, Int32, Pen)

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.

IsOutlineVisible(Point, Pen)

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.

IsOutlineVisible(Int32, Int32, Pen, Graphics)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified 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

Parameters

x
Int32

The x-coordinate of the point to test.

y
Int32

The y-coordinate of the point to test.

pen
Pen

The Pen to test.

graphics
Graphics

The Graphics for which to test visibility.

Returns

This method returns true if the specified point is contained within the outline of this GraphicsPath as drawn with the specified Pen; otherwise, false.

Examples

The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, an OnPaint event. The code performs the following actions:

  • Creates a path.

  • Adds a rectangle to the path.

  • Creates a wide pen and widens the path with that pen (to make the example clearer),

  • Tests a point (100, 50) to see if it lies within (under) one of the edges of the rectangle by calling IsOutlineVisible.

The result is shown in the message box (in this case, true). In other words the edge is rendered over that point.

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

Remarks

This method tests to see if the outline of a given path is rendered visible at the specified point. The coordinates of the point to be tested are given in world coordinates. The transform matrix of graphics is temporarily applied before testing for visibility.

Applies to

IsOutlineVisible(Point, Pen, Graphics)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified 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

Parameters

pt
Point

A Point that specifies the location to test.

pen
Pen

The Pen to test.

graphics
Graphics

The Graphics for which to test visibility.

Returns

This method returns true if the specified point is contained within the outline of this GraphicsPath as drawn with the specified Pen; otherwise, false.

Examples

For an example, see IsOutlineVisible(Int32, Int32, Pen, Graphics).

Remarks

This method tests to see if the outline of a given path is rendered visible at the specified point. The coordinates of the point to be tested are given in world coordinates. The transform matrix of graphics is temporarily applied before testing for visibility.

Applies to

IsOutlineVisible(Single, Single, Pen, Graphics)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified 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

Parameters

x
Single

The x-coordinate of the point to test.

y
Single

The y-coordinate of the point to test.

pen
Pen

The Pen to test.

graphics
Graphics

The Graphics for which to test visibility.

Returns

This method returns true if the specified point is contained within (under) the outline of this GraphicsPath as drawn with the specified Pen; otherwise, false.

Examples

For an example, see IsOutlineVisible(Int32, Int32, Pen, Graphics).

Remarks

This method tests to see if the outline of a given path is rendered visible at the specified point. The coordinates of the point to be tested are given in world coordinates. The transform matrix of the graphics parameter is temporarily applied before testing for visibility.

Applies to

IsOutlineVisible(Single, Single, Pen)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified 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

Parameters

x
Single

The x-coordinate of the point to test.

y
Single

The y-coordinate of the point to test.

pen
Pen

The Pen to test.

Returns

This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false.

Examples

For an example, see IsOutlineVisible(Int32, Int32, Pen, Graphics).

Remarks

This method tests to see if the outline of a given path is rendered visible at the specified point.

Applies to

IsOutlineVisible(PointF, Pen)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified 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

Parameters

point
PointF

A PointF that specifies the location to test.

pen
Pen

The Pen to test.

Returns

This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false.

Examples

For an example, see IsOutlineVisible(Int32, Int32, Pen, Graphics).

Remarks

This method tests to see if the outline of a given path is rendered visible at the specified point.

Applies to

IsOutlineVisible(PointF, Pen, Graphics)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified 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

Parameters

pt
PointF

A PointF that specifies the location to test.

pen
Pen

The Pen to test.

graphics
Graphics

The Graphics for which to test visibility.

Returns

This method returns true if the specified point is contained within (under) the outline of this GraphicsPath as drawn with the specified Pen; otherwise, false.

Examples

For an example, see IsOutlineVisible(Int32, Int32, Pen, Graphics).

Remarks

This method tests to see if the outline of a given path is rendered visible at the specified point. The coordinates of the point to be tested are given in world coordinates. The transform matrix of graphics is temporarily applied before testing for visibility.

Applies to

IsOutlineVisible(Int32, Int32, Pen)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified 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

Parameters

x
Int32

The x-coordinate of the point to test.

y
Int32

The y-coordinate of the point to test.

pen
Pen

The Pen to test.

Returns

This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false.

Examples

For an example, see IsOutlineVisible(Int32, Int32, Pen, Graphics).

Remarks

This method tests to see if the outline of a given path is rendered visible at the specified point.

Applies to

IsOutlineVisible(Point, Pen)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified 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

Parameters

point
Point

A Point that specifies the location to test.

pen
Pen

The Pen to test.

Returns

This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false.

Examples

For an example, see IsOutlineVisible(Int32, Int32, Pen, Graphics).

Remarks

This method tests to see if the outline of a given path is rendered visible at the specified point.

Applies to