Sdílet prostřednictvím


Graphics.ExcludeClip Metoda

Definice

Aktualizuje oblast klipu, Graphics aby se vyloučila oblast určená strukturou Rectangle .

Přetížení

Name Description
ExcludeClip(Region)

Aktualizuje oblast klipu, Graphics aby se vyloučila oblast určená parametrem Region.

ExcludeClip(Rectangle)

Aktualizuje oblast klipu, Graphics aby se vyloučila oblast určená strukturou Rectangle .

ExcludeClip(Region)

Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs

Aktualizuje oblast klipu, Graphics aby se vyloučila oblast určená parametrem Region.

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

Parametry

region
Region

Region určuje oblast, která se má vyloučit z oblasti klipu.

Příklady

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

  • Vytvoří obdélník o rozměrech 100 pixelů o 100 pixelech, jehož levý horní roh je na souřadnici (100, 100).

  • Nastaví oblast výřezu tak, aby se obdélník vyloučil.

  • Vyplní obdélník o rozměrech 300 pixelů o 300 pixelů, jehož levý horní roh je v souřadnici (0, 0) plným modrým kartáčem.

Výsledkem je modrý obdélník s čtvercovou oblastí směrem k jeho pravému dolnímu rohu.

public:
   void ExcludeClipRegion( PaintEventArgs^ e )
   {
      // Create rectangle for region.
      Rectangle excludeRect = Rectangle(100,100,200,200);

      // Create region for exclusion.
      System::Drawing::Region^ excludeRegion = gcnew System::Drawing::Region( excludeRect );

      // Set clipping region to exclude region.
      e->Graphics->ExcludeClip( excludeRegion );

      // Fill large rectangle to show clipping region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Blue ), 0, 0, 300, 300 );
   }
public void ExcludeClipRegion(PaintEventArgs e)
{
             
    // Create rectangle for region.
    Rectangle excludeRect = new Rectangle(100, 100, 200, 200);
             
    // Create region for exclusion.
    Region excludeRegion = new Region(excludeRect);
             
    // Set clipping region to exclude region.
    e.Graphics.ExcludeClip(excludeRegion);
             
    // Fill large rectangle to show clipping region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 300, 300);
}
Public Sub ExcludeClipRegion(ByVal e As PaintEventArgs)

    ' Create rectangle for region.
    Dim excludeRect As New Rectangle(100, 100, 200, 200)

    ' Create region for exclusion.
    Dim excludeRegion As New [Region](excludeRect)

    ' Set clipping region to exclude region.
    e.Graphics.ExcludeClip(excludeRegion)

    ' Fill large rectangle to show clipping region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Blue), 0, 0, _
    300, 300)
End Sub

Poznámky

Tato metoda vylučuje oblast určenou region parametrem z aktuální oblasti klipu a přiřadí výslednou oblast vlastnosti Clip této Graphics.

Platí pro

ExcludeClip(Rectangle)

Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs

Aktualizuje oblast klipu, Graphics aby se vyloučila oblast určená strukturou Rectangle .

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

Parametry

rect
Rectangle

Rectangle struktura, která určuje obdélník, který se má vyloučit z oblasti klipu.

Příklady

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

  • Vytvoří obdélník o rozměrech 100 pixelů o 100 pixelech, jehož levý horní roh je na souřadnici (100, 100).

  • Vytvoří oblast definovanou obdélníkem.

  • Nastaví oblast výřezu tak, aby se vyloučila obdélníková oblast.

  • Vyplní obdélník o rozměrech 300 pixelů o 300 pixelů, jehož levý horní roh je v souřadnici (0, 0) plným modrým kartáčem.

Výsledkem je modrý obdélník s čtverečnou oblastí směrem k jeho pravému dolnímu rohu.

public:
   void ExcludeClipRectangle( PaintEventArgs^ e )
   {
      // Create rectangle for exclusion.
      Rectangle excludeRect = Rectangle(100,100,200,200);

      // Set clipping region to exclude rectangle.
      e->Graphics->ExcludeClip( excludeRect );

      // Fill large rectangle to show clipping region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Blue ), 0, 0, 300, 300 );
   }
public void ExcludeClipRectangle(PaintEventArgs e)
{
             
    // Create rectangle for exclusion.
    Rectangle excludeRect = new Rectangle(100, 100, 200, 200);
             
    // Set clipping region to exclude rectangle.
    e.Graphics.ExcludeClip(excludeRect);
             
    // Fill large rectangle to show clipping region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 300, 300);
}
Public Sub ExcludeClipRectangle(ByVal e As PaintEventArgs)

    ' Create rectangle for exclusion.
    Dim excludeRect As New Rectangle(100, 100, 200, 200)

    ' Set clipping region to exclude rectangle.
    e.Graphics.ExcludeClip(excludeRect)

    ' Fill large rectangle to show clipping region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Blue), 0, 0, _
    300, 300)
End Sub

Poznámky

Tato metoda vylučuje oblast určenou rect parametrem z aktuální oblasti klipu a přiřadí výslednou oblast vlastnosti Clip této Graphics.

Platí pro