Share via


Renderer.SetViewTransform Method

Sets the Matrix object that represents the view transform that is used to render ink.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public Sub SetViewTransform ( _
    viewTransform As Matrix _
)
'Usage
Dim instance As Renderer 
Dim viewTransform As Matrix

instance.SetViewTransform(viewTransform)
public void SetViewTransform(
    Matrix viewTransform
)
public:
void SetViewTransform(
    Matrix^ viewTransform
)
public function SetViewTransform(
    viewTransform : Matrix
)

Parameters

  • viewTransform
    Type: System.Drawing.Drawing2D.Matrix

    The Matrix object that represents the geometric transformation values—rotation, scaling, shear, and reflection—to use to transform the ink from ink space coordinates to logical device context coordinates.

Remarks

The transformation applies to both the points and the pen width.

View transformation occurs after object transformation.

Examples

In this example, the GetViewTransform is used to obtain the current view transform matrix from the Renderer object in an InkOverlay object. Then a scaling factor of 2 in both the X and Y dimensions is applied. Finally, the SetViewTransform method is used to restore the original view transform.

' create a Matrix object and obtain the current view transform 
Dim origViewTransform As Matrix = New Matrix()
mInkOverlay.Renderer.GetViewTransform(origViewTransform)
' scale the ink - this affects the view transform
mInkOverlay.Renderer.Scale(2.0F, 2.0F)
' later, you can restore the view transform back to the original
mInkOverlay.Renderer.SetViewTransform(origViewTransform)
// create a Matrix object and obtain the current view transform
Matrix origViewTransform = new Matrix();
mInkOverlay.Renderer.GetViewTransform(ref origViewTransform);
// scale the ink - this affects the view transform
mInkOverlay.Renderer.Scale(2.0f, 2.0f);
// later, you can restore the view transform back to the original
mInkOverlay.Renderer.SetViewTransform(origViewTransform);

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

Renderer Class

Renderer Members

Microsoft.Ink Namespace

Renderer.GetObjectTransform

Renderer.GetViewTransform

Renderer.SetObjectTransform