Graphics.TranslateClip 메서드

정의

가로와 세로 방향으로 지정된 크기만큼 이 Graphics의 클립 영역을 변환합니다.

오버로드

TranslateClip(Int32, Int32)

가로와 세로 방향으로 지정된 크기만큼 이 Graphics의 클립 영역을 변환합니다.

TranslateClip(Single, Single)

가로와 세로 방향으로 지정된 크기만큼 이 Graphics의 클립 영역을 변환합니다.

TranslateClip(Int32, Int32)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

가로와 세로 방향으로 지정된 크기만큼 이 Graphics의 클립 영역을 변환합니다.

public:
 void TranslateClip(int dx, int dy);
public void TranslateClip (int dx, int dy);
member this.TranslateClip : int * int -> unit
Public Sub TranslateClip (dx As Integer, dy As Integer)

매개 변수

dx
Int32

변환의 X좌표입니다.

dy
Int32

변환의 Y좌표입니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • 클리핑 영역에 대한 사각형을 만듭니다.

  • 클리핑 영역을 사각형으로 설정합니다.

  • 클리핑 영역을 벡터(50, 50)로 변환합니다.

  • 큰 사각형을 단색 검은색 브러시로 채웁니다.

그 결과 변환된 작은 검은색 사각형이 생성됩니다.

public:
   void TranslateClipInt( 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 );

      // Translate clipping region.
      int dx = 50;
      int dy = 50;
      e->Graphics->TranslateClip( dx, dy );

      // Fill rectangle to demonstrate translated clip region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
   }
private void TranslateClipInt(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);

    // Translate clipping region.
    int dx = 50;
    int dy = 50;
    e.Graphics.TranslateClip(dx, dy);

    // Fill rectangle to demonstrate translated clip region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub TranslateClipInt(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)

    ' Translate clipping region.
    Dim dx As Integer = 50
    Dim dy As Integer = 50
    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

적용 대상

TranslateClip(Single, Single)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

가로와 세로 방향으로 지정된 크기만큼 이 Graphics의 클립 영역을 변환합니다.

public:
 void TranslateClip(float dx, float dy);
public void TranslateClip (float dx, float dy);
member this.TranslateClip : single * single -> unit
Public Sub TranslateClip (dx As Single, dy As Single)

매개 변수

dx
Single

변환의 X좌표입니다.

dy
Single

변환의 Y좌표입니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • 클리핑 영역에 대한 사각형을 만듭니다.

  • 클리핑 영역을 사각형으로 설정합니다.

  • 클리핑 영역을 벡터(50.0F, 50.0F)로 변환합니다.

  • 큰 사각형을 단색 검은색 브러시로 채웁니다.

그 결과 변환된 작은 검은색 사각형이 생성됩니다.

public:
   void TranslateClipFloat( 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 );

      // 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( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
   }
private 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);
}
Private Sub TranslateClipFloat(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)

    ' Translate clipping region.
    Dim dx As Single = 50.0F
    Dim dy As Single = 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)
End Sub

적용 대상