Region Constructeurs

Définition

Initialise un nouveau Region.

Surcharges

Region()

Initialise un nouveau Region.

Region(GraphicsPath)

Initialise un nouveau Region avec le GraphicsPath spécifié.

Region(RegionData)

Initialise un nouveau Region à partir des données spécifiées.

Region(Rectangle)

Initialise un nouveau Region à partir de la structure Rectangle spécifiée.

Region(RectangleF)

Initialise un nouveau Region à partir de la structure RectangleF spécifiée.

Region()

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

Initialise un nouveau Region.

public:
 Region();
public Region ();
Public Sub New ()

Remarques

Ce constructeur initialise un nouveau Region avec un intérieur infini.

S’applique à

Region(GraphicsPath)

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

Initialise un nouveau Region avec le GraphicsPath spécifié.

public:
 Region(System::Drawing::Drawing2D::GraphicsPath ^ path);
public Region (System.Drawing.Drawing2D.GraphicsPath path);
new System.Drawing.Region : System.Drawing.Drawing2D.GraphicsPath -> System.Drawing.Region
Public Sub New (path As GraphicsPath)

Paramètres

path
GraphicsPath

GraphicsPath qui définit le nouveau Region.

Exceptions

path a la valeur null.

Remarques

Cette méthode crée un nouveau Region avec un GraphicsPath. La nouvelle région est définie comme l’intérieur du GraphicsPath spécifié par le path paramètre .

S’applique à

Region(RegionData)

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

Initialise un nouveau Region à partir des données spécifiées.

public:
 Region(System::Drawing::Drawing2D::RegionData ^ rgnData);
public Region (System.Drawing.Drawing2D.RegionData rgnData);
new System.Drawing.Region : System.Drawing.Drawing2D.RegionData -> System.Drawing.Region
Public Sub New (rgnData As RegionData)

Paramètres

rgnData
RegionData

RegionData qui définit l’intérieur du nouveau Region.

Exceptions

rgnData a la valeur null.

Remarques

Cette méthode crée un nouveau Region avec un intérieur défini par un existant Region. Le rgnData paramètre est un tableau qui contient la définition d’un .Region

S’applique à

Region(Rectangle)

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

Initialise un nouveau Region à partir de la structure Rectangle spécifiée.

public:
 Region(System::Drawing::Rectangle rect);
public Region (System.Drawing.Rectangle rect);
new System.Drawing.Region : System.Drawing.Rectangle -> System.Drawing.Region
Public Sub New (rect As Rectangle)

Paramètres

rect
Rectangle

Structure Rectangle qui définit l'intérieur du nouveau Region.

Exemples

L’exemple de code suivant montre comment utiliser le constructeur et MakeEmpty la Region méthode. Cet exemple est conçu pour être utilisé avec Windows Forms. Create un formulaire et collez-y le code suivant. Appelez la FillEmptyRegion méthode dans la méthode de gestion des événements du Paint formulaire, en passant e comme PaintEventArgs.

private:
   void FillEmptyRegion( PaintEventArgs^ e )
   {
      // Create a region from a rectangle.
      Rectangle originalRectangle = Rectangle(40,40,40,50);
      System::Drawing::Region^ smallRegion = gcnew System::Drawing::Region( originalRectangle );

      // Call MakeEmpty.
      smallRegion->MakeEmpty();

      // Fill the region in red and draw the original rectangle
      // in black. Note there is nothing filled in.
      e->Graphics->FillRegion( Brushes::Red, smallRegion );
      e->Graphics->DrawRectangle( Pens::Black, originalRectangle );
   }
private void FillEmptyRegion(PaintEventArgs e)
{

    // Create a region from a rectangle.
    Rectangle originalRectangle = new Rectangle(40, 40, 40, 50);
    Region smallRegion = new Region(originalRectangle);

    // Call MakeEmpty.
    smallRegion.MakeEmpty();

    // Fill the region in red and draw the original rectangle
    // in black. Note there is nothing filled in.
    e.Graphics.FillRegion(Brushes.Red, smallRegion);
    e.Graphics.DrawRectangle(Pens.Black, originalRectangle);
}
Private Sub FillEmptyRegion(ByVal e As PaintEventArgs)

    ' Create a region from a rectangle.
    Dim originalRectangle As New Rectangle(40, 40, 40, 50)
    Dim smallRegion As New Region(originalRectangle)

    ' Call MakeEmpty.
    smallRegion.MakeEmpty()

    ' Fill the region in red and draw the original rectangle
    ' in black. Note there is nothing filled in.
    e.Graphics.FillRegion(Brushes.Red, smallRegion)
    e.Graphics.DrawRectangle(Pens.Black, originalRectangle)

End Sub

Remarques

Cette méthode crée un nouveau Region avec un intérieur rectangulaire. L’intérieur est défini par le rect paramètre .

S’applique à

Region(RectangleF)

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

Initialise un nouveau Region à partir de la structure RectangleF spécifiée.

public:
 Region(System::Drawing::RectangleF rect);
public Region (System.Drawing.RectangleF rect);
new System.Drawing.Region : System.Drawing.RectangleF -> System.Drawing.Region
Public Sub New (rect As RectangleF)

Paramètres

rect
RectangleF

Structure RectangleF qui définit l'intérieur du nouveau Region.

Remarques

Cette méthode crée un nouveau Region avec un intérieur rectangulaire. L’intérieur est défini par le rect paramètre .

S’applique à