Region.Intersect Metoda

Definicja

Aktualizacje to Region do skrzyżowania siebie z określonym Region.

Przeciążenia

Intersect(GraphicsPath)

Aktualizacje to Region do skrzyżowania siebie z określonym GraphicsPath.

Intersect(Rectangle)

Aktualizacje to Region do przecięcia się z określoną Rectangle strukturą.

Intersect(RectangleF)

Aktualizacje to Region do przecięcia się z określoną RectangleF strukturą.

Intersect(Region)

Aktualizacje to Region do skrzyżowania siebie z określonym Region.

Intersect(GraphicsPath)

Źródło:
Region.cs
Źródło:
Region.cs
Źródło:
Region.cs

Aktualizacje to Region do skrzyżowania siebie z określonym 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)

Parametry

path
GraphicsPath

Element GraphicsPath do przecięć za pomocą tego Regionpolecenia .

Przykłady

Aby zapoznać się z przykładami kodu, zobacz RectangleF.Intersect(RectangleF) metody i Complement(GraphicsPath) .

Dotyczy

Intersect(Rectangle)

Źródło:
Region.cs
Źródło:
Region.cs
Źródło:
Region.cs

Aktualizacje to Region do przecięcia się z określoną Rectangle strukturą.

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)

Parametry

rect
Rectangle

Struktura Rectangle do przecięć za pomocą tego Regionobiektu .

Przykłady

Aby zapoznać się z przykładem kodu, zobacz metodę Intersect(RectangleF) .

Dotyczy

Intersect(RectangleF)

Źródło:
Region.cs
Źródło:
Region.cs
Źródło:
Region.cs

Aktualizacje to Region do przecięcia się z określoną RectangleF strukturą.

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)

Parametry

rect
RectangleF

Struktura RectangleF do przecięć za pomocą tego Regionobiektu .

Przykłady

Poniższy przykład kodu jest przeznaczony do użycia z Windows Forms i wymaga PaintEventArgseparametru Paint programu obsługi zdarzeń. Kod wykonuje następujące akcje:

  • Tworzy pierwszy prostokąt i rysuje go na ekranie w kolorze czarnym.

  • Tworzy drugi prostokąt i rysuje go na ekranie na czerwono.

  • Tworzy region z pierwszego prostokąta.

  • Pobiera obszar skrzyżowania dla regionu w połączeniu z drugim prostokątem.

  • Wypełnia obszar skrzyżowania niebieskim i rysuje go na ekranie.

Zwróć uwagę, że tylko nakładający się obszar dla regionu i prostokąta jest niebieski.

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

Dotyczy

Intersect(Region)

Źródło:
Region.cs
Źródło:
Region.cs
Źródło:
Region.cs

Aktualizacje to Region do skrzyżowania siebie z określonym 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)

Parametry

region
Region

Element Region do przecięć za pomocą tego Regionpolecenia .

Przykłady

Aby zapoznać się z przykładami kodu, zobacz metodę Intersect(RectangleF) and Complement(GraphicsPath).

Dotyczy