Share via


Region.Intersect Metoda

Definice

Aktualizace k Region průniku sebe sama se zadaným Regionparametrem .

Přetížení

Intersect(GraphicsPath)

Aktualizace k Region průniku sebe sama se zadaným GraphicsPathparametrem .

Intersect(Rectangle)

Aktualizace k Region průniku sebe sama se zadanou Rectangle strukturou.

Intersect(RectangleF)

Aktualizace k Region průniku sebe sama se zadanou RectangleF strukturou.

Intersect(Region)

Aktualizace k Region průniku sebe sama se zadaným Regionparametrem .

Intersect(GraphicsPath)

Zdroj:
Region.cs
Zdroj:
Region.cs
Zdroj:
Region.cs

Aktualizace k Region průniku sebe sama se zadaným GraphicsPathparametrem .

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

Objekt GraphicsPath se protíná s tímto Regionobjektem .

Příklady

Příklady kódu najdete v metodách RectangleF.Intersect(RectangleF) a Complement(GraphicsPath) .

Platí pro

Intersect(Rectangle)

Zdroj:
Region.cs
Zdroj:
Region.cs
Zdroj:
Region.cs

Aktualizace k Region průniku sebe sama se zadanou Rectangle strukturou.

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 , která se má protínnout s tímto Regionobjektem .

Příklady

Příklad kódu najdete v Intersect(RectangleF) metodě.

Platí pro

Intersect(RectangleF)

Zdroj:
Region.cs
Zdroj:
Region.cs
Zdroj:
Region.cs

Aktualizace k Region průniku sebe sama se zadanou RectangleF strukturou.

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 , která se má protínnout s tímto Regionobjektem .

Příklady

Následující příklad kódu je určen pro použití s model Windows Forms a vyžaduje PaintEventArgse, což je parametr obslužné rutiny Paint události. Kód provede následující akce:

  • Vytvoří první obdélník a nakreslí ho na obrazovku černě.

  • Vytvoří druhý obdélník a červeně ho nakreslí na obrazovku.

  • Vytvoří oblast z prvního obdélníku.

  • Získá oblast průsečíku oblasti v kombinaci s druhým obdélníkem.

  • Vyplní oblast průsečíku modrou a nakreslí ji na obrazovku.

Všimněte si, že modrá je pouze překrývající se oblast a obdélník.

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

Platí pro

Intersect(Region)

Zdroj:
Region.cs
Zdroj:
Region.cs
Zdroj:
Region.cs

Aktualizace k Region průniku sebe sama se zadaným Regionparametrem .

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

Objekt Region se protíná s tímto Regionobjektem .

Příklady

Příklady kódu najdete v Intersect(RectangleF) metodě a Complement(GraphicsPath) ..

Platí pro