Compartir a través de


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 void SetViewTransform (
    Matrix viewTransform
)
public function SetViewTransform (
    viewTransform : Matrix
)
Not applicable.

Parameters

  • viewTransform
    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.

Example

This C# example scales the ink in an InkOverlay object, theInkOverlay, by a factor of 1.5. The example gets the current view transform matrix from the Renderer object, applies the scaling, and then sets it as the Renderer object's new view transform. Note that the pen width also increases by a factor of 1.5.

using System.Drawing.Drawing2D;
...
private void ZoomBy150percent()
        {
            Matrix transformation = new Matrix();
            theInkOverlay.Renderer.GetViewTransform(ref transformation);
            transformation.Scale(1.5f, 1.5f);
            theInkOverlay.Renderer.SetViewTransform(transformation);
        }

This Microsoft® Visual Basic® .NET example scales the ink in an InkOverlay object, theInkOverlay, by a factor of 1.5. The example gets the current view transform matrix from the Renderer object, applies the scaling, and then sets it as the Renderer object's new view transform. Note that the pen width also increases by a factor of 1.5.

Imports System.Drawing.Drawing2D
...
Private Sub ZoomBy150percent()
    Dim transformation As New Matrix()
    theInkOverlay.Renderer.GetViewTransform(transformation)
    transformation.Scale(1.5, 1.5)
    theInkOverlay.Renderer.SetViewTransform(transformation)
End Sub

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

Renderer Class
Renderer Members
Microsoft.Ink Namespace
Renderer.GetObjectTransform
Renderer.GetViewTransform
Renderer.SetObjectTransform