다음을 통해 공유


Strokes.Transform 메서드 (Matrix)

업데이트: 2007년 11월

펜 너비에 영향을 주지 않고 Strokes 컬렉션에 선형 변환을 적용합니다.

네임스페이스:  Microsoft.Ink
어셈블리:  Microsoft.Ink(Microsoft.Ink.dll)

구문

‘선언
Public Sub Transform ( _
    inkTransform As Matrix _
)
‘사용 방법
Dim instance As Strokes
Dim inkTransform As Matrix

instance.Transform(inkTransform)
public void Transform(
    Matrix inkTransform
)
public:
void Transform(
    Matrix^ inkTransform
)
public void Transform(
    Matrix inkTransform
)
public function Transform(
    inkTransform : Matrix
)

매개 변수

설명

펜 너비가 아닌 점에만 변환이 적용됩니다. 변환에 펜 너비를 포함하는 값을 설정하려면 이 메서드의 Transform(Matrix, Boolean) 오버로드를 사용합니다.

선형 변환은 배율 조정, 회전, 이동 및 이러한 변환의 조합을 나타낼 수 있습니다.

예제

이 예제에서는 InkOverlay 개체에 연결된 Strokes 컬렉션을 180도 회전합니다. 이때 Strokes 컬렉션의 경계 상자 중심을 주위로 회전합니다.

' Access to the Strokes property returns a copy of the Strokes object.
' This copy must be implicitly (via using statement) or explicitly
' disposed of in order to avoid a memory leak.
Using allStrokes As Strokes = mInkOverlay.Ink.Strokes

    Dim inkTransform As Matrix = New Matrix()
    Dim bounds As Rectangle = allStrokes.GetBoundingBox()
    Dim center As PointF = _
        New PointF(0.5F * (bounds.Left + bounds.Right), _
                   0.5F * (bounds.Top + bounds.Bottom))
    ' Translate to center of bounding box
    inkTransform.Translate(center.X, center.Y)
    ' Rotate by 180 degrees
    inkTransform.Rotate(180.0F)
    ' Translate back
    inkTransform.Translate(-center.X, -center.Y)
    ' Transform strokes
    allStrokes.Transform(inkTransform)
End Using
// Access to the Strokes property returns a copy of the Strokes object.
// This copy must be implicitly (via using statement) or explicitly
// disposed of in order to avoid a memory leak.
using (Strokes allStrokes = mInkOverlay.Ink.Strokes)
{
    Matrix inkTransform = new Matrix();
    Rectangle bounds = allStrokes.GetBoundingBox();
    PointF center = new PointF(0.5f * (bounds.Left + bounds.Right),
                               0.5f * (bounds.Top + bounds.Bottom));
    // Translate to center of bounding box
    inkTransform.Translate(center.X, center.Y);
    // Rotate by 180 degrees
    inkTransform.Rotate(180f);
    // Translate back
    inkTransform.Translate(-center.X, -center.Y);
    // Transform strokes
    allStrokes.Transform(inkTransform);
}

플랫폼

Windows Vista

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

Strokes 클래스

Strokes 멤버

Transform 오버로드

Microsoft.Ink 네임스페이스

Strokes.Scale

Strokes.Move

Strokes.Rotate

Stroke.Transform