Share via


SetViewTransform Method

SetViewTransform Method

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

Declaration

[C++]

        HRESULT SetViewTransform(
    [in] IInkTransform* viewTransform
);
      

[Microsoft® Visual Basic® 6.0]

        Public Sub SetViewTransform( _
    viewTransform As InkTransform _
)
      

Parameters

viewTransform

[in] The InkTransform object that represents the geometric transformation — rotation, scaling, shear, and reflection — values to use to transform the stroke coordinates within the ink space.

A NULL (Nothing in Visual Basic 6.0) value for the viewTransform parameter correlates to the identity transform.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER A parameter contained an invalid pointer.
E_INVALIDARG viewTransform does not point to a compatible InkTransform object.
E_INK_EXCEPTION An exception occurred inside the method.

Remarks

The transformation applies to both the points and pen width.

View transformation occurs after object transformation.

The pen width is calculated by multiplying the specified pen width (or default of 53, if unspecified) by the square root of the determinant of the view transform.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example calls SetViewTransform in the event handler for a command button to modify the view transform to rotate the ink 180 degrees around the point (4000, 4000) in ink space.

        Option Explicit
Dim theInkCollector As InkCollector

Private Sub Command1_Click()
    Dim theInkTransform As New InkTransform
    'Rotate the ink through 180 degrees around (4000, 4000)
    theInkTransform.SetTransform -1!, 0!, 0!, -1!, 8000!, 8000!
    theInkCollector.Renderer.SetViewTransform theInkTransform
    Form1.Refresh
End Sub

Private Sub Form_Load()
    Set theInkCollector = New InkCollector
    theInkCollector.hWnd = Me.hWnd
    theInkCollector.Enabled = True
End Sub
      

Applies To