Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tests whether the specified rectangle is contained within this Region.
| IsVisible(Single, Single, Single, Single, Graphics) |
Tests whether any portion of the specified rectangle is contained within this Region when drawn using the specified Graphics. |
| IsVisible(Int32, Int32, Int32, Int32, Graphics) |
Tests whether any portion of the specified rectangle is contained within this Region when drawn using the specified Graphics. |
| IsVisible(Single, Single, Single, Single) |
Tests whether any portion of the specified rectangle is contained within this Region. |
| IsVisible(Int32, Int32, Int32, Int32) |
Tests whether any portion of the specified rectangle is contained within this Region. |
| IsVisible(Single, Single, Graphics) |
Tests whether the specified point is contained within this Region when drawn using the specified Graphics. |
| IsVisible(Int32, Int32, Graphics) |
Tests whether the specified point is contained within this Region object when drawn using the specified Graphics object. |
| IsVisible(Single, Single) |
Tests whether the specified point is contained within this Region. |
| IsVisible(Point) |
Tests whether the specified Point structure is contained within this Region. |
| IsVisible(Rectangle, Graphics) |
Tests whether any portion of the specified Rectangle structure is contained within this Region when drawn using the specified Graphics. |
| IsVisible(PointF, Graphics) |
Tests whether the specified PointF structure is contained within this Region when drawn using the specified Graphics. |
| IsVisible(Point, Graphics) |
Tests whether the specified Point structure is contained within this Region when drawn using the specified Graphics. |
| IsVisible(RectangleF) |
Tests whether any portion of the specified RectangleF structure is contained within this Region. |
| IsVisible(Rectangle) |
Tests whether any portion of the specified Rectangle structure is contained within this Region. |
| IsVisible(PointF) |
Tests whether the specified PointF structure is contained within this Region. |
| IsVisible(RectangleF, Graphics) |
Tests whether any portion of the specified RectangleF structure is contained within this Region when drawn using the specified Graphics. |
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
The x-coordinate of the upper-left corner of the rectangle to test.
The y-coordinate of the upper-left corner of the rectangle to test.
The width of the rectangle to test.
The height of the rectangle to test.
true when any portion of the specified rectangle is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
The current transformation of the graphics context is used to compute the region interior and the rectangle coordinates on the drawing surface.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
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
The x-coordinate of the upper-left corner of the rectangle to test.
The y-coordinate of the upper-left corner of the rectangle to test.
The width of the rectangle to test.
The height of the rectangle to test.
true when any portion of the specified rectangle is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
The current transformation of the graphics context is used to compute the region interior and the rectangle coordinates on the drawing surface.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Tests whether any portion of the specified rectangle is contained within this 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
The x-coordinate of the upper-left corner of the rectangle to test.
The y-coordinate of the upper-left corner of the rectangle to test.
The width of the rectangle to test.
The height of the rectangle to test.
true when any portion of the specified rectangle is contained within this Region object; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Tests whether any portion of the specified rectangle is contained within this 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
The x-coordinate of the upper-left corner of the rectangle to test.
The y-coordinate of the upper-left corner of the rectangle to test.
The width of the rectangle to test.
The height of the rectangle to test.
true when any portion of the specified rectangle is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
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
The x-coordinate of the point to test.
The y-coordinate of the point to test.
true when the specified point is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
The current transformation of the graphics context is used to compute the region interior and the point coordinates on the drawing surface.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
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
The x-coordinate of the point to test.
The y-coordinate of the point to test.
true when the specified point is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
The current transformation of the graphics context is used to compute the region interior and the point coordinates on the drawing surface.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Tests whether the specified point is contained within this 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
The x-coordinate of the point to test.
The y-coordinate of the point to test.
true when the specified point is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
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 when point is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
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 when any portion of the rect is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
The current transformation of the graphics context is used to compute the region interior and the rectangle coordinates on the drawing surface.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
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 when point is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
The current transformation of the graphics context is used to compute the region interior and the point coordinates on the drawing surface.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
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 when point is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
The current transformation of the graphics context is used to compute the region interior and the point coordinates on the drawing surface.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Tests whether any portion of the specified RectangleF structure is contained within this 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
The RectangleF structure to test.
true when any portion of rect is contained within this Region; otherwise, false.
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. The code performs the following actions:
Creates the first rectangle and draws it to the screen in blue.
Creates the second rectangle and draws it to the screen in red.
Creates a region from the first rectangle.
Determines if any portion of the rectangle intersects with the region.
Displays the true or false result on the screen.
Notice that the rectangle intersects the region, so the result is 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
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
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
This method returns true when any portion of rect is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
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 when point is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Tests whether any portion of the specified RectangleF structure is contained within this Region when drawn using the specified 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
The RectangleF structure to test.
true when rect is contained within this Region; otherwise, false.
For a code example, see the IsVisible(RectangleF) method.
The current transformation of the graphics context is used to compute the region interior and the rectangle coordinates on the drawing surface.
| Product | Versions |
|---|---|
| .NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
| .NET Standard | 2.0 (package-provided) |
| Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in