Region.Intersect Méthode

Définition

Met à jour ce Region sur l’intersection entre celui-ci et le Region spécifié.

Surcharges

Intersect(GraphicsPath)

Met à jour ce Region sur l’intersection entre celui-ci et le GraphicsPath spécifié.

Intersect(Rectangle)

Met à jour cette Region sur l’intersection entre celui-ci et la structure Rectangle spécifiée.

Intersect(RectangleF)

Met à jour cette Region sur l’intersection entre celui-ci et la structure RectangleF spécifiée.

Intersect(Region)

Met à jour ce Region sur l’intersection entre celui-ci et le Region spécifié.

Intersect(GraphicsPath)

Source:
Region.cs
Source:
Region.cs
Source:
Region.cs

Met à jour ce Region sur l’intersection entre celui-ci et le GraphicsPath spécifié.

public:
 void Intersect(System::Drawing::Drawing2D::GraphicsPath ^ path);
public void Intersect (System.Drawing.Drawing2D.GraphicsPath path);
member this.Intersect : System.Drawing.Drawing2D.GraphicsPath -> unit
Public Sub Intersect (path As GraphicsPath)

Paramètres

path
GraphicsPath

Le GraphicsPath en intersection avec ce Region.

Exemples

Pour obtenir des exemples de code, consultez les RectangleF.Intersect(RectangleF) méthodes et Complement(GraphicsPath) .

S’applique à

Intersect(Rectangle)

Source:
Region.cs
Source:
Region.cs
Source:
Region.cs

Met à jour cette Region sur l’intersection entre celui-ci et la structure Rectangle spécifiée.

public:
 void Intersect(System::Drawing::Rectangle rect);
public void Intersect (System.Drawing.Rectangle rect);
member this.Intersect : System.Drawing.Rectangle -> unit
Public Sub Intersect (rect As Rectangle)

Paramètres

rect
Rectangle

La structure Rectangle en intersection avec cette Region.

Exemples

Pour obtenir un exemple de code, consultez la Intersect(RectangleF) méthode .

S’applique à

Intersect(RectangleF)

Source:
Region.cs
Source:
Region.cs
Source:
Region.cs

Met à jour cette Region sur l’intersection entre celui-ci et la structure RectangleF spécifiée.

public:
 void Intersect(System::Drawing::RectangleF rect);
public void Intersect (System.Drawing.RectangleF rect);
member this.Intersect : System.Drawing.RectangleF -> unit
Public Sub Intersect (rect As RectangleF)

Paramètres

rect
RectangleF

La structure RectangleF en intersection avec cette Region.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse, qui est un paramètre du Paint gestionnaire d’événements. Le code effectue les actions suivantes :

  • Crée le premier rectangle et le dessine à l’écran en noir.

  • Crée le deuxième rectangle et le dessine à l’écran en rouge.

  • Crée une région à partir du premier rectangle.

  • Obtient la zone d’intersection de la région lorsqu’elle est combinée avec le deuxième rectangle.

  • Remplit la zone d’intersection avec du bleu et la dessine à l’écran.

Notez que seule la zone superposée pour la région et le rectangle est bleue.

public:
   void Intersect_RectF_Example( PaintEventArgs^ e )
   {
      // Create the first rectangle and draw it to the screen in black.
      Rectangle regionRect = Rectangle(20,20,100,100);
      e->Graphics->DrawRectangle( Pens::Black, regionRect );

      // create the second rectangle and draw it to the screen in red.
      RectangleF complementRect = RectangleF(90,30,100,100);
      e->Graphics->DrawRectangle( Pens::Red, Rectangle::Round( complementRect ) );

      // Create a region using the first rectangle.
      System::Drawing::Region^ myRegion = gcnew System::Drawing::Region( regionRect );

      // Get the area of intersection for myRegion when combined with
      // complementRect.
      myRegion->Intersect( complementRect );

      // Fill the intersection area of myRegion with blue.
      SolidBrush^ myBrush = gcnew SolidBrush( Color::Blue );
      e->Graphics->FillRegion( myBrush, myRegion );
   }
public void Intersect_RectF_Example(PaintEventArgs e)
{
             
    // Create the first rectangle and draw it to the screen in black.
    Rectangle regionRect = new Rectangle(20, 20, 100, 100);
    e.Graphics.DrawRectangle(Pens.Black, regionRect);
             
    // create the second rectangle and draw it to the screen in red.
    RectangleF complementRect = new RectangleF(90, 30, 100, 100);
    e.Graphics.DrawRectangle(Pens.Red,
        Rectangle.Round(complementRect));
             
    // Create a region using the first rectangle.
    Region myRegion = new Region(regionRect);
             
    // Get the area of intersection for myRegion when combined with
             
    // complementRect.
    myRegion.Intersect(complementRect);
             
    // Fill the intersection area of myRegion with blue.
    SolidBrush myBrush = new SolidBrush(Color.Blue);
    e.Graphics.FillRegion(myBrush, myRegion);
}
Public Sub Intersect_RectF_Example(ByVal e As PaintEventArgs)

    ' Create the first rectangle and draw it to the screen in black.
    Dim regionRect As New Rectangle(20, 20, 100, 100)
    e.Graphics.DrawRectangle(Pens.Black, regionRect)

    ' create the second rectangle and draw it to the screen in red.
    Dim complementRect As New RectangleF(90, 30, 100, 100)
    e.Graphics.DrawRectangle(Pens.Red, _
    Rectangle.Round(complementRect))

    ' Create a region using the first rectangle.
    Dim myRegion As New [Region](regionRect)

    ' Get the area of intersection for myRegion when combined with
    ' complementRect.
    myRegion.Intersect(complementRect)

    ' Fill the intersection area of myRegion with blue.
    Dim myBrush As New SolidBrush(Color.Blue)
    e.Graphics.FillRegion(myBrush, myRegion)
End Sub

S’applique à

Intersect(Region)

Source:
Region.cs
Source:
Region.cs
Source:
Region.cs

Met à jour ce Region sur l’intersection entre celui-ci et le Region spécifié.

public:
 void Intersect(System::Drawing::Region ^ region);
public void Intersect (System.Drawing.Region region);
member this.Intersect : System.Drawing.Region -> unit
Public Sub Intersect (region As Region)

Paramètres

region
Region

Le Region en intersection avec ce Region.

Exemples

Pour obtenir des exemples de code, consultez la Intersect(RectangleF) méthode et Complement(GraphicsPath).

S’applique à