업데이트: 2007년 11월
펜 너비에 변환을 적용하는 옵션을 사용하여 Strokes 컬렉션에 선형 변환을 적용합니다.
네임스페이스: Microsoft.Ink
어셈블리: Microsoft.Ink(Microsoft.Ink.dll)
구문
‘선언
Public Sub Transform ( _
inkTransform As Matrix, _
applyOnPenWidth As Boolean _
)
‘사용 방법
Dim instance As Strokes
Dim inkTransform As Matrix
Dim applyOnPenWidth As Boolean
instance.Transform(inkTransform, applyOnPenWidth)
public void Transform(
Matrix inkTransform,
bool applyOnPenWidth
)
public:
void Transform(
Matrix^ inkTransform,
bool applyOnPenWidth
)
public void Transform(
Matrix inkTransform,
boolean applyOnPenWidth
)
public function Transform(
inkTransform : Matrix,
applyOnPenWidth : boolean
)
매개 변수
- inkTransform
형식: System.Drawing.Drawing2D.Matrix
Strokes 컬렉션에 사용할 System.Drawing.Drawing2D.Matrix 변환입니다.
- applyOnPenWidth
형식: System.Boolean
Strokes 컬렉션에 있는 Stroke 개체의 DrawingAttributes에서 잉크 너비에 변환을 적용할지 여부를 나타내는 부울 값입니다.값
의미
true
점과 펜 너비 모두에 변환이 적용됩니다.
false
점에만 변환이 적용됩니다.
설명
선형 변환은 배율 조정, 회전, 이동 및 이러한 변환의 조합을 나타낼 수 있습니다.
펜 너비의 배율이 변환에 맞게 적절히 조정되는 경우 지정된 펜 너비(지정되지 않은 경우에는 기본값인 53)에 변환 행렬식의 제곱근을 곱하여 그려지는 펜 너비를 계산합니다.
예제
이 예제에서는 InkOverlay 개체에 연결된 Strokes 컬렉션의 배율을 2배로 조정합니다. 이때 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)
' Scale by factor of 2
inkTransform.Scale(2.0F, 2.0F)
' Translate back
inkTransform.Translate(-center.X, -center.Y)
' Transform strokes
allStrokes.Transform(inkTransform, True)
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);
// Scale by factor of 2
inkTransform.Scale(2.0F, 2.0F);
// Translate back
inkTransform.Translate(-center.X, -center.Y);
// Transform strokes
allStrokes.Transform(inkTransform, true);
}
플랫폼
Windows Vista
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원