指定した量だけ水平方向および垂直方向に、 Graphics オブジェクトのクリッピング領域を平行移動します。
オーバーロードの一覧
指定した量だけ水平方向および垂直方向に、 Graphics オブジェクトのクリッピング領域を平行移動します。
[Visual Basic] Overloads Public Sub TranslateClip(Integer, Integer)
[JScript] public function TranslateClip(int, int);
指定した量だけ水平方向および垂直方向に、 Graphics オブジェクトのクリッピング領域を平行移動します。
[Visual Basic] Overloads Public Sub TranslateClip(Single, Single)
使用例
[Visual Basic, C#] 次の例は、Windows フォームでの使用を意図してデザインされており、 Paint イベント ハンドラのパラメータである PaintEventArgs e が必要です。このコードは次のアクションを実行します。
- クリッピング領域に使用する四角形を作成します。
- クリッピング領域を四角形に設定します。
- ベクタ (50.0F, 50.0F) でクリッピング領域を平行移動します。
- 黒いソリッド ブラシで大きな四角形を塗りつぶします。
[Visual Basic, C#] 平行移動した小さな黒い四角形が生成されます。
[Visual Basic, C#] メモ ここでは、TranslateClip のオーバーロード形式のうちの 1 つだけについて、使用例を示します。その他の例については、各オーバーロード形式のトピックを参照してください。
Public Sub TranslateClipFloat(e As PaintEventArgs)
' Create rectangle for clipping region.
Dim clipRect As New RectangleF(0F, 0F, 100F, 100F)
' Set clipping region of graphics to rectangle.
e.Graphics.SetClip(clipRect)
' Translate clipping region.
Dim dx As Single = 50F
Dim dy As Single = 50F
e.Graphics.TranslateClip(dx, dy)
' Fill rectangle to demonstrate translated clip region.
e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
500, 300)
End Sub
[C#]
public void TranslateClipFloat(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);
// Translate clipping region.
float dx = 50.0F;
float dy = 50.0F;
e.Graphics.TranslateClip(dx, dy);
// Fill rectangle to demonstrate translated clip region.
e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。