Graphics.SetClip メソッドとは? わかりやすく解説

Graphics.SetClip メソッド (GraphicsPath)

この Graphicsクリッピング領域指定した GraphicsPath オブジェクト設定します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub SetClip ( _
    path As GraphicsPath _
)
Dim instance As Graphics
Dim path As GraphicsPath

instance.SetClip(path)
public void SetClip (
    GraphicsPath path
)
public:
void SetClip (
    GraphicsPath^ path
)
public void SetClip (
    GraphicsPath path
)
public function SetClip (
    path : GraphicsPath
)

パラメータ

path

新しクリップ領域を表す GraphicsPath。

解説解説
使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

黒で塗りつぶされ楕円生成されます。

Public 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
public 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);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.SetClip メソッド (Region, CombineMode)

この Graphicsクリッピング領域を、現在のクリップ領域指定した Region とを組み合わせる指定操作結果設定します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub SetClip ( _
    region As Region, _
    combineMode As CombineMode _
)
Dim instance As Graphics
Dim region As Region
Dim combineMode As CombineMode

instance.SetClip(region, combineMode)
public void SetClip (
    Region region,
    CombineMode combineMode
)
public:
void SetClip (
    Region^ region, 
    CombineMode combineMode
)
public void SetClip (
    Region region, 
    CombineMode combineMode
)
public function SetClip (
    region : Region, 
    combineMode : CombineMode
)

パラメータ

region

組み合わせる Region

combineMode

使用する組み合わせ操作指定する CombineMode 列挙体のメンバ

使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

黒で塗りつぶされ小さな四角形生成されます。

Public 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
public 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);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.SetClip メソッド (Graphics)

この Graphicsクリッピング領域指定した GraphicsClip プロパティ設定します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub SetClip ( _
    g As Graphics _
)
public void SetClip (
    Graphics g
)
public:
void SetClip (
    Graphics^ g
)
public void SetClip (
    Graphics g
)

パラメータ

g

新しクリップ領域取得元となる Graphics

使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse と、たとえば Form などの thisForm が必要です。このコード次のアクション実行します

黒で塗りつぶされ小さな正方形生成されます。

Public 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
public 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();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.SetClip メソッド (RectangleF)

この Graphicsクリッピング領域RectangleF 構造体指定され四角形設定します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub SetClip ( _
    rect As RectangleF _
)
Dim instance As Graphics
Dim rect As RectangleF

instance.SetClip(rect)
public void SetClip (
    RectangleF rect
)
public:
void SetClip (
    RectangleF rect
)
public void SetClip (
    RectangleF rect
)
public function SetClip (
    rect : RectangleF
)

パラメータ

rect

新しクリップ領域を表す RectangleF 構造体

使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

黒で塗りつぶされ小さな四角形生成されます。

Public 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
public 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);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.SetClip メソッド (Rectangle)

この Graphicsクリッピング領域Rectangle 構造体指定され四角形設定します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub SetClip ( _
    rect As Rectangle _
)
Dim instance As Graphics
Dim rect As Rectangle

instance.SetClip(rect)
public void SetClip (
    Rectangle rect
)
public:
void SetClip (
    Rectangle rect
)
public void SetClip (
    Rectangle rect
)
public function SetClip (
    rect : Rectangle
)

パラメータ

rect

新しクリップ領域を表す Rectangle 構造体

使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

黒で塗りつぶされ小さな四角形生成されます。

Public 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
public 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);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.SetClip メソッド (Graphics, CombineMode)

この Graphicsクリッピング領域を、現在のクリップ領域指定した GraphicsClip プロパティとを組み合わせる指定操作結果設定します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub SetClip ( _
    g As Graphics, _
    combineMode As CombineMode _
)
Dim instance As Graphics
Dim g As Graphics
Dim combineMode As CombineMode

instance.SetClip(g, combineMode)
public void SetClip (
    Graphics g,
    CombineMode combineMode
)
public:
void SetClip (
    Graphics^ g, 
    CombineMode combineMode
)
public void SetClip (
    Graphics g, 
    CombineMode combineMode
)
public function SetClip (
    g : Graphics, 
    combineMode : CombineMode
)

パラメータ

g

組み合わせるクリップ領域指定する Graphics

combineMode

使用する組み合わせ操作指定する CombineMode 列挙体のメンバ

使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse と、たとえば Form などの thisForm が必要です。このコード次のアクション実行します

黒で塗りつぶされ小さな正方形生成されます。

Public 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
public 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();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.SetClip メソッド (GraphicsPath, CombineMode)

この Graphicsクリッピング領域を、現在のクリップ領域指定した GraphicsPath とを組み合わせる指定操作結果設定します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub SetClip ( _
    path As GraphicsPath, _
    combineMode As CombineMode _
)
Dim instance As Graphics
Dim path As GraphicsPath
Dim combineMode As CombineMode

instance.SetClip(path, combineMode)
public void SetClip (
    GraphicsPath path,
    CombineMode combineMode
)
public:
void SetClip (
    GraphicsPath^ path, 
    CombineMode combineMode
)
public void SetClip (
    GraphicsPath path, 
    CombineMode combineMode
)
public function SetClip (
    path : GraphicsPath, 
    combineMode : CombineMode
)

パラメータ

path

組み合わせる GraphicsPath。

combineMode

使用する組み合わせ操作指定する CombineMode 列挙体のメンバ

解説解説
使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

黒で塗りつぶされ楕円生成されます。

Public 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
public 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);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.SetClip メソッド (Rectangle, CombineMode)

この Graphicsクリッピング領域現在のクリップ領域Rectangle 構造体指定され四角形とを組み合わせる指定操作結果設定します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub SetClip ( _
    rect As Rectangle, _
    combineMode As CombineMode _
)
Dim instance As Graphics
Dim rect As Rectangle
Dim combineMode As CombineMode

instance.SetClip(rect, combineMode)
public void SetClip (
    Rectangle rect,
    CombineMode combineMode
)
public:
void SetClip (
    Rectangle rect, 
    CombineMode combineMode
)
public void SetClip (
    Rectangle rect, 
    CombineMode combineMode
)
public function SetClip (
    rect : Rectangle, 
    combineMode : CombineMode
)

パラメータ

rect

組み合わせる Rectangle 構造体

combineMode

使用する組み合わせ操作指定する CombineMode 列挙体のメンバ

使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

黒で塗りつぶされ小さな四角形生成されます。

Public 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
public 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);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.SetClip メソッド (RectangleF, CombineMode)

この Graphicsクリッピング領域現在のクリップ領域RectangleF 構造体指定され四角形とを組み合わせる指定操作結果設定します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub SetClip ( _
    rect As RectangleF, _
    combineMode As CombineMode _
)
Dim instance As Graphics
Dim rect As RectangleF
Dim combineMode As CombineMode

instance.SetClip(rect, combineMode)
public void SetClip (
    RectangleF rect,
    CombineMode combineMode
)
public:
void SetClip (
    RectangleF rect, 
    CombineMode combineMode
)
public void SetClip (
    RectangleF rect, 
    CombineMode combineMode
)
public function SetClip (
    rect : RectangleF, 
    combineMode : CombineMode
)

パラメータ

rect

組み合わせる RectangleF 構造体

combineMode

使用する組み合わせ操作指定する CombineMode 列挙体のメンバ

使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

黒で塗りつぶされ小さな四角形生成されます。

Public 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
public 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);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.SetClip メソッド

この Graphicsクリッピング領域指定した GraphicsClip プロパティ設定します
オーバーロードの一覧オーバーロードの一覧

名前 説明
Graphics.SetClip (Graphics) この Graphicsクリッピング領域指定した GraphicsClip プロパティ設定します
Graphics.SetClip (GraphicsPath) この Graphicsクリッピング領域指定した GraphicsPath オブジェクト設定します
Graphics.SetClip (Rectangle) この Graphicsクリッピング領域Rectangle 構造体指定され四角形設定します
Graphics.SetClip (RectangleF) この Graphicsクリッピング領域を RectangleF 構造体指定され四角形設定します
Graphics.SetClip (Graphics, CombineMode) この Graphicsクリッピング領域を、現在のクリップ領域指定した GraphicsClip プロパティとを組み合わせる指定操作結果設定します
Graphics.SetClip (GraphicsPath, CombineMode) この Graphicsクリッピング領域を、現在のクリップ領域指定した GraphicsPath とを組み合わせる指定操作結果設定します
Graphics.SetClip (Rectangle, CombineMode) この Graphicsクリッピング領域現在のクリップ領域Rectangle 構造体指定され四角形とを組み合わせる指定操作結果設定します
Graphics.SetClip (RectangleF, CombineMode) この Graphicsクリッピング領域現在のクリップ領域RectangleF 構造体指定され四角形とを組み合わせる指定操作結果設定します
Graphics.SetClip (Region, CombineMode) この Graphicsクリッピング領域を、現在のクリップ領域指定した Region とを組み合わせる指定操作結果設定します
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Graphics.SetClip メソッド」の関連用語

Graphics.SetClip メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Graphics.SetClip メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS