Graphics.ExcludeClip Metoda

Definice

Aktualizace oblasti klipu této Graphics oblasti vyloučíte oblast určenou strukturouRectangle.

Přetížení

ExcludeClip(Region)

Aktualizace oblast klipu této Graphics oblasti, aby se vyloučila oblast určená parametrem Region.

ExcludeClip(Rectangle)

Aktualizace oblasti klipu této Graphics oblasti vyloučíte oblast určenou strukturouRectangle.

ExcludeClip(Region)

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

Aktualizace oblast klipu této Graphics oblasti, 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á z oblasti klipu vyloučit.

Příklady

Následující příklad kódu je navrž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ří obdélník o úhlu 100 pixelů a 100 pixelů, jehož levý horní roh je na souřadnici (100, 100).

  • Nastaví oblast oříznutí tak, aby se obdélník vyloučil.

  • Vyplní obdélník o úhlu 300 pixelů a 300 pixelů, jehož levý horní roh je v souřadnici (0, 0) plným modrým štětcem.

Výsledkem je modrý obdélník s chybějící čtvercovou oblastí v pravém dolním 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 vyloučí oblast určenou parametrem region z aktuální oblasti klipu a přiřadí výslednou oblast vlastnosti Clip .Graphics

Platí pro

ExcludeClip(Rectangle)

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

Aktualizace oblasti klipu této Graphics oblasti vyloučíte oblast určenou strukturouRectangle.

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 určuje obdélník, který se má vyloučit z oblasti klipu.

Příklady

Následující příklad kódu je navrž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ří obdélník o úhlu 100 pixelů a 100 pixelů, jehož levý horní roh je na souřadnici (100, 100).

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

  • Nastaví oblast oříznutí tak, aby se vyloučila obdélníková oblast.

  • Vyplní obdélník o úhlu 300 pixelů a 300 pixelů, jehož levý horní roh je v souřadnici (0, 0) plným modrým štětcem.

Výsledkem je modrý obdélník s čtvercovou oblastí v pravém dolním 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 vyloučí oblast určenou parametrem rect z aktuální oblasti klipu a přiřadí výslednou oblast vlastnosti Clip .Graphics

Platí pro