GraphicsPath.IsOutlineVisible GraphicsPath.IsOutlineVisible 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(Point, Pen) IsOutlineVisible(Point, 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(PointF, Pen) IsOutlineVisible(PointF, 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(Point, Pen, Graphics) IsOutlineVisible(Point, Pen, 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(PointF, Pen, Graphics) IsOutlineVisible(PointF, Pen, Graphics) 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) IsOutlineVisible(Int32, Int32, Pen) 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(Single, Single, Pen) IsOutlineVisible(Single, Single, Pen) 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(Int32, Int32, Pen, Graphics) IsOutlineVisible(Int32, Int32, Pen, Graphics) 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(Single, Single, Pen, Graphics) IsOutlineVisible(Single, Single, Pen, 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(Point, Pen) IsOutlineVisible(Point, Pen) IsOutlineVisible(Point, Pen)

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

Parameters

point
Point Point Point

A Point that specifies the location to test.

pen
Pen 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.

IsOutlineVisible(PointF, Pen) IsOutlineVisible(PointF, Pen) IsOutlineVisible(PointF, Pen)

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

Parameters

point
PointF PointF PointF

A PointF that specifies the location to test.

pen
Pen 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.

IsOutlineVisible(Point, Pen, Graphics) IsOutlineVisible(Point, Pen, 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.

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

Parameters

pt
Point Point Point

A Point that specifies the location to test.

pen
Pen Pen Pen

The Pen to test.

graphics
Graphics 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.

IsOutlineVisible(PointF, Pen, Graphics) IsOutlineVisible(PointF, Pen, Graphics) 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.

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

Parameters

pt
PointF PointF PointF

A PointF that specifies the location to test.

pen
Pen Pen Pen

The Pen to test.

graphics
Graphics 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.

IsOutlineVisible(Int32, Int32, Pen) IsOutlineVisible(Int32, Int32, Pen) IsOutlineVisible(Int32, Int32, Pen)

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

Parameters

x
Int32 Int32 Int32

The x-coordinate of the point to test.

y
Int32 Int32 Int32

The y-coordinate of the point to test.

pen
Pen 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.

IsOutlineVisible(Single, Single, Pen) IsOutlineVisible(Single, Single, Pen) IsOutlineVisible(Single, Single, Pen)

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

Parameters

x
Single Single Single

The x-coordinate of the point to test.

y
Single Single Single

The y-coordinate of the point to test.

pen
Pen 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.

IsOutlineVisible(Int32, Int32, Pen, Graphics) IsOutlineVisible(Int32, Int32, Pen, Graphics) 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.

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

Parameters

x
Int32 Int32 Int32

The x-coordinate of the point to test.

y
Int32 Int32 Int32

The y-coordinate of the point to test.

pen
Pen Pen Pen

The Pen to test.

graphics
Graphics 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 PaintEventArgse, 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.

IsOutlineVisible(Single, Single, Pen, Graphics) IsOutlineVisible(Single, Single, Pen, 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.

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

Parameters

x
Single Single Single

The x-coordinate of the point to test.

y
Single Single Single

The y-coordinate of the point to test.

pen
Pen Pen Pen

The Pen to test.

graphics
Graphics 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