Compartilhar via


Renderer.SetViewTransform Method

Renderer.SetViewTransform Method

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

Definition

Visual Basic .NET Public Sub SetViewTransform( _
ByVal viewTransform As Matrix _
)
C# public void SetViewTransform(
Matrix viewTransform
);
Managed C++ public: void SetViewTransform(
Matrix *viewTransform
);

Parameters

viewTransform System.Drawing.Drawing2D.Matrix. The Matrix Leave Site 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

[C#]

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);
        }
                

[VB.NET]

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
                

See Also