Graphics.SetClip Yöntem

Tanım

Bunun GraphicsClip kırpma bölgesini belirtilen Graphicsözelliğinin değerine ayarlar.

Aşırı Yüklemeler

SetClip(Region, CombineMode)

Bunun Graphics kırpma bölgesini, geçerli küçük resim bölgesiyle belirtilen öğesini birleştiren belirtilen işlemin sonucuna Regionayarlar.

SetClip(RectangleF, CombineMode)

Bunun Graphics kırpma bölgesini, geçerli küçük resim bölgesini ve bir RectangleF yapı tarafından belirtilen dikdörtgeni birleştiren belirtilen işlemin sonucuna ayarlar.

SetClip(Rectangle, CombineMode)

Bunun Graphics kırpma bölgesini, geçerli küçük resim bölgesini ve bir Rectangle yapı tarafından belirtilen dikdörtgeni birleştiren belirtilen işlemin sonucuna ayarlar.

SetClip(Graphics, CombineMode)

Bunun Graphics kırpma bölgesini, geçerli klip bölgesinin belirtilen birleştirme işleminin sonucuna ve Clip belirtilen Graphicsöğesinin özelliğine ayarlar.

SetClip(RectangleF)

Bunun Graphics kırpma bölgesini bir RectangleF yapı tarafından belirtilen dikdörtgene ayarlar.

SetClip(Rectangle)

Bunun Graphics kırpma bölgesini bir Rectangle yapı tarafından belirtilen dikdörtgene ayarlar.

SetClip(Graphics)

Bunun Graphics kırpma bölgesini belirtilen Graphicsöğesinin Clip özelliğine ayarlar.

SetClip(GraphicsPath)

Bunun Graphics kırpma bölgesini belirtilen GraphicsPatholarak ayarlar.

SetClip(GraphicsPath, CombineMode)

Bunun Graphics kırpma bölgesini, geçerli küçük resim bölgesiyle belirtilen öğesini birleştiren belirtilen işlemin sonucuna GraphicsPathayarlar.

SetClip(Region, CombineMode)

Kaynak:
Graphics.cs
Kaynak:
Graphics.cs
Kaynak:
Graphics.cs

Bunun Graphics kırpma bölgesini, geçerli küçük resim bölgesiyle belirtilen öğesini birleştiren belirtilen işlemin sonucuna Regionayarlar.

public:
 void SetClip(System::Drawing::Region ^ region, System::Drawing::Drawing2D::CombineMode combineMode);
public void SetClip (System.Drawing.Region region, System.Drawing.Drawing2D.CombineMode combineMode);
member this.SetClip : System.Drawing.Region * System.Drawing.Drawing2D.CombineMode -> unit
Public Sub SetClip (region As Region, combineMode As CombineMode)

Parametreler

region
Region

Region öğesini seçin.

combineMode
CombineMode

Kullanılacak birleştirme işlemini belirten numaralandırmadan CombineMode üye.

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin bir parametresi olan öğesini gerektirirPaintEventArgse.Paint Kod aşağıdaki eylemleri gerçekleştirir:

  • Kırpma bölgesi için küçük bir dikdörtgen oluşturur.

  • Kırpma bölgesini üyeyle dikdörtgene Replace ayarlar.

  • Büyük bir dikdörtgeni düz siyah bir fırçayla doldurur.

Sonuç küçük, dolgulu, siyah bir dikdörtgendir.

public:
   void SetClipRegionCombine( PaintEventArgs^ e )
   {
      // Create region for clipping.
      System::Drawing::Region^ clipRegion = gcnew System::Drawing::Region( Rectangle(0,0,100,100) );

      // Set clipping region of graphics to region.
      e->Graphics->SetClip( clipRegion, CombineMode::Replace );

      // Fill rectangle to demonstrate clip region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
   }
private void SetClipRegionCombine(PaintEventArgs e)
{

    // Create region for clipping.
    Region clipRegion = new Region(new Rectangle(0, 0, 100, 100));

    // Set clipping region of graphics to region.
    e.Graphics.SetClip(clipRegion, CombineMode.Replace);

    // Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipRegionCombine(ByVal e As PaintEventArgs)

    ' Create region for clipping.
    Dim clipRegion As New [Region](New Rectangle(0, 0, 100, 100))

    ' Set clipping region of graphics to region.
    e.Graphics.SetClip(clipRegion, CombineMode.Replace)

    ' Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
    500, 300)
End Sub

Şunlara uygulanır

SetClip(RectangleF, CombineMode)

Kaynak:
Graphics.cs
Kaynak:
Graphics.cs
Kaynak:
Graphics.cs

Bunun Graphics kırpma bölgesini, geçerli küçük resim bölgesini ve bir RectangleF yapı tarafından belirtilen dikdörtgeni birleştiren belirtilen işlemin sonucuna ayarlar.

public:
 void SetClip(System::Drawing::RectangleF rect, System::Drawing::Drawing2D::CombineMode combineMode);
public void SetClip (System.Drawing.RectangleF rect, System.Drawing.Drawing2D.CombineMode combineMode);
member this.SetClip : System.Drawing.RectangleF * System.Drawing.Drawing2D.CombineMode -> unit
Public Sub SetClip (rect As RectangleF, combineMode As CombineMode)

Parametreler

rect
RectangleF

RectangleF birleştirecek yapıya sahip.

combineMode
CombineMode

CombineMode Kullanılacak birleştirme işlemini belirten numaralandırmanın üyesi.

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin bir parametresi olan öğesini gerektirirPaintEventArgse.Paint Kod aşağıdaki eylemleri gerçekleştirir:

  • Kırpma bölgesi için küçük bir dikdörtgen oluşturur.

  • Kırpma bölgesini üyeyle dikdörtgene Replace ayarlar.

  • Büyük bir dikdörtgeni düz siyah bir fırçayla doldurur.

Sonuç küçük, dolgulu, siyah bir dikdörtgendir.

public:
   void SetClipRectangleFCombine( PaintEventArgs^ e )
   {
      // Create rectangle for clipping region.
      RectangleF clipRect = RectangleF(0.0F,0.0F,100.0F,100.0F);

      // Set clipping region of graphics to rectangle.
      e->Graphics->SetClip( clipRect, CombineMode::Replace );

      // Fill rectangle to demonstrate clip region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
   }
private void SetClipRectangleFCombine(PaintEventArgs e)
{

    // Create rectangle for clipping region.
    RectangleF clipRect = new RectangleF(0.0F, 0.0F, 100.0F, 100.0F);

    // Set clipping region of graphics to rectangle.
    e.Graphics.SetClip(clipRect, CombineMode.Replace);

    // Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipRectangleFCombine(ByVal e As PaintEventArgs)

    ' Create rectangle for clipping region.
    Dim clipRect As New RectangleF(0.0F, 0.0F, 100.0F, 100.0F)

    ' Set clipping region of graphics to rectangle.
    e.Graphics.SetClip(clipRect, CombineMode.Replace)

    ' Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
    500, 300)
End Sub

Şunlara uygulanır

SetClip(Rectangle, CombineMode)

Kaynak:
Graphics.cs
Kaynak:
Graphics.cs
Kaynak:
Graphics.cs

Bunun Graphics kırpma bölgesini, geçerli küçük resim bölgesini ve bir Rectangle yapı tarafından belirtilen dikdörtgeni birleştiren belirtilen işlemin sonucuna ayarlar.

public:
 void SetClip(System::Drawing::Rectangle rect, System::Drawing::Drawing2D::CombineMode combineMode);
public void SetClip (System.Drawing.Rectangle rect, System.Drawing.Drawing2D.CombineMode combineMode);
member this.SetClip : System.Drawing.Rectangle * System.Drawing.Drawing2D.CombineMode -> unit
Public Sub SetClip (rect As Rectangle, combineMode As CombineMode)

Parametreler

rect
Rectangle

Rectangle birleştirecek yapıya sahip.

combineMode
CombineMode

CombineMode Kullanılacak birleştirme işlemini belirten numaralandırmanın üyesi.

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin bir parametresi olan öğesini gerektirirPaintEventArgse.Paint Kod aşağıdaki eylemleri gerçekleştirir:

  • Kırpma bölgesi için küçük bir dikdörtgen oluşturur.

  • Kırpma bölgesini üyeyle dikdörtgene Replace ayarlar.

  • Büyük bir dikdörtgeni düz siyah bir fırçayla doldurur.

Sonuç küçük, dolgulu, siyah bir dikdörtgendir.

public:
   void SetClipRectangleCombine( PaintEventArgs^ e )
   {
      // Create rectangle for clipping region.
      Rectangle clipRect = Rectangle(0,0,100,100);

      // Set clipping region of graphics to rectangle.
      e->Graphics->SetClip( clipRect, CombineMode::Replace );

      // Fill rectangle to demonstrate clip region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
   }
private void SetClipRectangleCombine(PaintEventArgs e)
{

    // Create rectangle for clipping region.
    Rectangle clipRect = new Rectangle(0, 0, 100, 100);

    // Set clipping region of graphics to rectangle.
    e.Graphics.SetClip(clipRect, CombineMode.Replace);

    // Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipRectangleCombine(ByVal e As PaintEventArgs)

    ' Create rectangle for clipping region.
    Dim clipRect As New Rectangle(0, 0, 100, 100)

    ' Set clipping region of graphics to rectangle.
    e.Graphics.SetClip(clipRect, CombineMode.Replace)

    ' Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
    500, 300)
End Sub

Şunlara uygulanır

SetClip(Graphics, CombineMode)

Kaynak:
Graphics.cs
Kaynak:
Graphics.cs
Kaynak:
Graphics.cs

Bunun Graphics kırpma bölgesini, geçerli klip bölgesinin belirtilen birleştirme işleminin sonucuna ve Clip belirtilen Graphicsöğesinin özelliğine ayarlar.

public:
 void SetClip(System::Drawing::Graphics ^ g, System::Drawing::Drawing2D::CombineMode combineMode);
public void SetClip (System.Drawing.Graphics g, System.Drawing.Drawing2D.CombineMode combineMode);
member this.SetClip : System.Drawing.Graphics * System.Drawing.Drawing2D.CombineMode -> unit
Public Sub SetClip (g As Graphics, combineMode As CombineMode)

Parametreler

g
Graphics

Graphics birleştirecek küçük resim bölgesini belirtir.

combineMode
CombineMode

CombineMode Kullanılacak birleştirme işlemini belirten numaralandırmanın üyesi.

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin bir parametresi olan ve örneğin parametresi olan Form öğesini gerektirirPaintEventArgse.PaintthisForm Kod aşağıdaki eylemleri gerçekleştirir:

  • Örneğinden thisFormForm geçici Graphics bir oluşturur.

  • Geçici Graphics kırpma bölgesini küçük bir kareye ayarlar.

  • Formun grafik nesnesinin kırpma bölgesini üyeyle yenininkine GraphicsReplace Güncelleştirmeler.

  • Büyük bir dikdörtgeni düz siyah bir fırçayla doldurur.

Sonuç küçük, dolgulu, siyah bir karedir.

public:
   void SetClipGraphicsCombine( PaintEventArgs^ e )
   {
      // Create temporary graphics object and set its clipping region.
      Graphics^ newGraphics = this->CreateGraphics();
      newGraphics->SetClip( Rectangle(0,0,100,100) );

      // Update clipping region of graphics to clipping region of new
      // graphics.
      e->Graphics->SetClip( newGraphics, CombineMode::Replace );

      // Fill rectangle to demonstrate clip region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );

      // Release new graphics.
      delete newGraphics;
   }
private void SetClipGraphicsCombine(PaintEventArgs e)
{

    // Create temporary graphics object and set its clipping region.
    Graphics newGraphics = this.CreateGraphics();
    newGraphics.SetClip(new Rectangle(0, 0, 100, 100));

    // Update clipping region of graphics to clipping region of new

    // graphics.
    e.Graphics.SetClip(newGraphics, CombineMode.Replace);

    // Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);

    // Release new graphics.
    newGraphics.Dispose();
}
Private Sub SetClipGraphicsCombine(ByVal e As PaintEventArgs)

    ' Create temporary graphics object and set its clipping region.
    Dim newGraphics As Graphics = Me.CreateGraphics()
    newGraphics.SetClip(New Rectangle(0, 0, 100, 100))

    ' Update clipping region of graphics to clipping region of new

    ' graphics.
    e.Graphics.SetClip(newGraphics, CombineMode.Replace)

    ' Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
    500, 300)

    ' Release new graphics.
    newGraphics.Dispose()
End Sub

Şunlara uygulanır

SetClip(RectangleF)

Kaynak:
Graphics.cs
Kaynak:
Graphics.cs
Kaynak:
Graphics.cs

Bunun Graphics kırpma bölgesini bir RectangleF yapı tarafından belirtilen dikdörtgene ayarlar.

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

Parametreler

rect
RectangleF

RectangleF yeni küçük resim bölgesini temsil eden yapı.

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin bir parametresi olan öğesini gerektirirPaintEventArgse.Paint Kod aşağıdaki eylemleri gerçekleştirir:

  • Kırpma bölgesi için küçük bir dikdörtgen oluşturur.

  • Kırpma bölgesini dikdörtgen olarak ayarlar.

  • Büyük bir dikdörtgeni düz siyah bir fırçayla doldurur.

Sonuç küçük, dolgulu, siyah bir dikdörtgendir.

public:
   void SetClipRectangleF( PaintEventArgs^ e )
   {
      // Create rectangle for clipping region.
      RectangleF clipRect = RectangleF(0.0F,0.0F,100.0F,100.0F);

      // Set clipping region of graphics to rectangle.
      e->Graphics->SetClip( clipRect );

      // Fill rectangle to demonstrate clip region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
   }
private void SetClipRectangleF(PaintEventArgs e)
{

    // Create rectangle for clipping region.
    RectangleF clipRect = new RectangleF(0.0F, 0.0F, 100.0F, 100.0F);

    // Set clipping region of graphics to rectangle.
    e.Graphics.SetClip(clipRect);

    // Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipRectangleF(ByVal e As PaintEventArgs)

    ' Create rectangle for clipping region.
    Dim clipRect As New RectangleF(0.0F, 0.0F, 100.0F, 100.0F)

    ' Set clipping region of graphics to rectangle.
    e.Graphics.SetClip(clipRect)

    ' Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
    500, 300)
End Sub

Şunlara uygulanır

SetClip(Rectangle)

Kaynak:
Graphics.cs
Kaynak:
Graphics.cs
Kaynak:
Graphics.cs

Bunun Graphics kırpma bölgesini bir Rectangle yapı tarafından belirtilen dikdörtgene ayarlar.

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

Parametreler

rect
Rectangle

Rectangle yeni küçük resim bölgesini temsil eden yapı.

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin bir parametresi olan öğesini gerektirirPaintEventArgse.Paint Kod aşağıdaki eylemleri gerçekleştirir:

  • Kırpma bölgesi için küçük bir dikdörtgen oluşturur.

  • Kırpma bölgesini dikdörtgen olarak ayarlar.

  • Büyük bir dikdörtgeni düz siyah bir fırçayla doldurur.

Sonuç küçük, dolgulu, siyah bir dikdörtgendir.

public:
   void SetClipRectangle( PaintEventArgs^ e )
   {
      // Create rectangle for clipping region.
      Rectangle clipRect = Rectangle(0,0,100,100);

      // Set clipping region of graphics to rectangle.
      e->Graphics->SetClip( clipRect );

      // Fill rectangle to demonstrate clip region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
   }
private void SetClipRectangle(PaintEventArgs e)
{

    // Create rectangle for clipping region.
    Rectangle clipRect = new Rectangle(0, 0, 100, 100);

    // Set clipping region of graphics to rectangle.
    e.Graphics.SetClip(clipRect);

    // Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipRectangle(ByVal e As PaintEventArgs)

    ' Create rectangle for clipping region.
    Dim clipRect As New Rectangle(0, 0, 100, 100)

    ' Set clipping region of graphics to rectangle.
    e.Graphics.SetClip(clipRect)

    ' Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
    500, 300)
End Sub

Şunlara uygulanır

SetClip(Graphics)

Kaynak:
Graphics.cs
Kaynak:
Graphics.cs
Kaynak:
Graphics.cs

Bunun Graphics kırpma bölgesini belirtilen Graphicsöğesinin Clip özelliğine ayarlar.

public:
 void SetClip(System::Drawing::Graphics ^ g);
public void SetClip (System.Drawing.Graphics g);
member this.SetClip : System.Drawing.Graphics -> unit
Public Sub SetClip (g As Graphics)

Parametreler

g
Graphics

Graphics yeni küçük resim bölgesinin alındığı yer.

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin bir parametresi olan ve örneğin parametresi olan Form öğesini gerektirirPaintEventArgse.PaintthisForm Kod aşağıdaki eylemleri gerçekleştirir:

  • Örneğinden thisFormForm geçici Graphics bir oluşturur.

  • Geçici Graphics kırpma bölgesini küçük bir kareye ayarlar.

  • Formun grafik nesnesinin kırpma bölgesini geçici Graphicsolanla Güncelleştirmeler.

  • Büyük bir dikdörtgeni düz siyah bir fırçayla doldurur.

Sonuç küçük, dolgulu, siyah bir karedir.

public:
   void SetClipGraphics( PaintEventArgs^ e )
   {
      // Create temporary graphics object and set its clipping region.
      Graphics^ newGraphics = this->CreateGraphics();
      newGraphics->SetClip( Rectangle(0,0,100,100) );

      // Update clipping region of graphics to clipping region of new
      // graphics.
      e->Graphics->SetClip( newGraphics );

      // Fill rectangle to demonstrate clip region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );

      // Release new graphics.
      delete newGraphics;
   }
private void SetClipGraphics(PaintEventArgs e)
{

    // Create temporary graphics object and set its clipping region.
    Graphics newGraphics = this.CreateGraphics();
    newGraphics.SetClip(new Rectangle(0, 0, 100, 100));

    // Update clipping region of graphics to clipping region of new

    // graphics.
    e.Graphics.SetClip(newGraphics);

    // Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);

    // Release new graphics.
    newGraphics.Dispose();
}
Private Sub SetClipGraphics(ByVal e As PaintEventArgs)

    ' Create temporary graphics object and set its clipping region.
    Dim newGraphics As Graphics = Me.CreateGraphics()
    newGraphics.SetClip(New Rectangle(0, 0, 100, 100))

    ' Update clipping region of graphics to clipping region of new

    ' graphics.
    e.Graphics.SetClip(newGraphics)

    ' Fill rectangle to demonstrate clip region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
    500, 300)

    ' Release new graphics.
    newGraphics.Dispose()
End Sub

Şunlara uygulanır

SetClip(GraphicsPath)

Kaynak:
Graphics.cs
Kaynak:
Graphics.cs
Kaynak:
Graphics.cs

Bunun Graphics kırpma bölgesini belirtilen GraphicsPatholarak ayarlar.

public:
 void SetClip(System::Drawing::Drawing2D::GraphicsPath ^ path);
public void SetClip (System.Drawing.Drawing2D.GraphicsPath path);
member this.SetClip : System.Drawing.Drawing2D.GraphicsPath -> unit
Public Sub SetClip (path As GraphicsPath)

Parametreler

path
GraphicsPath

GraphicsPath yeni küçük resim bölgesini temsil eder.

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin bir parametresi olan öğesini gerektirirPaintEventArgse.Paint Kod aşağıdaki eylemleri gerçekleştirir:

  • Bir grafik yolu oluşturur ve yola bir üç nokta ekler.

  • Kırpma bölgesini eliptik yola ayarlar.

  • Büyük bir dikdörtgeni düz siyah bir fırçayla doldurur.

Sonuç, dolu, siyah bir elipstir.

public:
   void SetClipPath( PaintEventArgs^ e )
   {
      // Create graphics path.
      GraphicsPath^ clipPath = gcnew GraphicsPath;
      clipPath->AddEllipse( 0, 0, 200, 100 );

      // Set clipping region to path.
      e->Graphics->SetClip( clipPath );

      // Fill rectangle to demonstrate clipping region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
   }
private void SetClipPath(PaintEventArgs e)
{

    // Create graphics path.
    GraphicsPath clipPath = new GraphicsPath();
    clipPath.AddEllipse(0, 0, 200, 100);

    // Set clipping region to path.
    e.Graphics.SetClip(clipPath);

    // Fill rectangle to demonstrate clipping region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipPath(ByVal e As PaintEventArgs)

    ' Create graphics path.
    Dim clipPath As New GraphicsPath
    clipPath.AddEllipse(0, 0, 200, 100)

    ' Set clipping region to path.
    e.Graphics.SetClip(clipPath)

    ' Fill rectangle to demonstrate clipping region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
    500, 300)
End Sub

Açıklamalar

Parametresiyle path temsil edilen grafik yolu kapatılmazsa, yolu kapatmak için son noktadan ilk noktaya ek bir kesim eklenir.

Şunlara uygulanır

SetClip(GraphicsPath, CombineMode)

Kaynak:
Graphics.cs
Kaynak:
Graphics.cs
Kaynak:
Graphics.cs

Bunun Graphics kırpma bölgesini, geçerli küçük resim bölgesiyle belirtilen öğesini birleştirerek belirtilen işlemin sonucuna GraphicsPathayarlar.

public:
 void SetClip(System::Drawing::Drawing2D::GraphicsPath ^ path, System::Drawing::Drawing2D::CombineMode combineMode);
public void SetClip (System.Drawing.Drawing2D.GraphicsPath path, System.Drawing.Drawing2D.CombineMode combineMode);
member this.SetClip : System.Drawing.Drawing2D.GraphicsPath * System.Drawing.Drawing2D.CombineMode -> unit
Public Sub SetClip (path As GraphicsPath, combineMode As CombineMode)

Parametreler

path
GraphicsPath

GraphicsPath öğesini seçin.

combineMode
CombineMode

CombineMode Kullanılacak birleştirme işlemini belirten numaralandırmanın üyesi.

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin bir parametresi olan öğesini gerektirirPaintEventArgse.Paint Kod aşağıdaki eylemleri gerçekleştirir:

  • Bir grafik yolu oluşturur ve yola bir üç nokta ekler.

  • Kırpma bölgesini üyeyle birlikte Replace eliptik yola ayarlar.

  • Büyük bir dikdörtgeni düz siyah bir fırçayla doldurur.

Sonuç, dolu, siyah bir elipstir.

public:
   void SetClipPathCombine( PaintEventArgs^ e )
   {
      // Create graphics path.
      GraphicsPath^ clipPath = gcnew GraphicsPath;
      clipPath->AddEllipse( 0, 0, 200, 100 );

      // Set clipping region to path.
      e->Graphics->SetClip( clipPath, CombineMode::Replace );

      // Fill rectangle to demonstrate clipping region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
   }
private void SetClipPathCombine(PaintEventArgs e)
{

    // Create graphics path.
    GraphicsPath clipPath = new GraphicsPath();
    clipPath.AddEllipse(0, 0, 200, 100);

    // Set clipping region to path.
    e.Graphics.SetClip(clipPath, CombineMode.Replace);

    // Fill rectangle to demonstrate clipping region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipPathCombine(ByVal e As PaintEventArgs)

    ' Create graphics path.
    Dim clipPath As New GraphicsPath
    clipPath.AddEllipse(0, 0, 200, 100)

    ' Set clipping region to path.
    e.Graphics.SetClip(clipPath, CombineMode.Replace)

    ' Fill rectangle to demonstrate clipping region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
    500, 300)
End Sub

Açıklamalar

Parametresi tarafından path temsil edilen grafik yolu kapatılmazsa, yolu kapatmak için son noktadan ilk noktaya ek bir kesim eklenir.

Şunlara uygulanır