Region.Intersect Méthode

Définition

Met à jour ceci Region à l’intersection de lui-même avec le .Region

Surcharges

Nom Description
Intersect(GraphicsPath)

Met à jour ceci Region à l’intersection de lui-même avec le .GraphicsPath

Intersect(Rectangle)

Met à jour ceci Region à l’intersection de lui-même avec la structure spécifiée Rectangle .

Intersect(RectangleF)

Met à jour ceci Region à l’intersection de lui-même avec la structure spécifiée RectangleF .

Intersect(Region)

Met à jour ceci Region à l’intersection de lui-même avec le .Region

Intersect(GraphicsPath)

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

Met à jour ceci Region à l’intersection de lui-même avec le .GraphicsPath

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

À GraphicsPath croiser avec ce Region.

Exemples

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

S’applique à

Intersect(Rectangle)

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

Met à jour ceci Region à l’intersection de lui-même avec la structure spécifiée Rectangle .

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

Structure Rectangle à croiser avec ce 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
Source:
Region.cs
Source:
Region.cs
Source:
Region.cs
Source:
Region.cs
Source:
Region.cs

Met à jour ceci Region à l’intersection de lui-même avec la structure spécifiée RectangleF .

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

Structure RectangleF à croiser avec ce 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 gestionnaire d’événements Paint. Le code effectue les actions suivantes :

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

  • Crée le deuxième rectangle et le dessine sur 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 au deuxième rectangle.

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

Notez que seule la zone qui se chevauche pour la région et le rectangle est bleu.

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
Source:
Region.cs
Source:
Region.cs
Source:
Region.cs
Source:
Region.cs
Source:
Region.cs

Met à jour ceci Region à l’intersection de lui-même avec le .Region

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

À Region croiser avec ce Region.

Exemples

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

S’applique à