Freigeben über


GetObjectTransform Method

GetObjectTransform Method

Gets the InkTransform object that represents the object transform that was used to render ink.

Declaration

[C++]

HRESULT GetObjectTransform(
    [in] IInkTransform* objectTransform
);

[Microsoft® Visual Basic® 6.0]

Public Sub GetObjectTransform( _
    objectTransform As InkTransform _
)

Parameters

objectTransform

[out] 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.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER A parameter contained an invalid pointer.
E_INK_EXCEPTION An exception occurred inside the method.

Remarks

Any translations applied to this transform should be in ink space units (1 unit = .01mm).

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example shows a simple application with one command button named btnRotate on the main form, which when clicked, gets the current object transform matrix from the InkRenderer object in the InkCollector, theInkCollector, and rotates it about the origin by 22.5 degrees, sets the transform back into the InkRenderer, and redraws. This has the effect of rotating the ink clockwise one sixteenth of the way around the origin, so sixteen clicks of the button will bring the ink back to its original position.

Dim theInkCollector As InkCollector

Private Sub btnRotate_Click()
    Dim theInkTransform As InkTransform
    Set theInkTransform = New InkTransform
    theInkCollector.Renderer.GetObjectTransform theInkTransform
    theInkTransform.Rotate 22.5
    theInkCollector.Renderer.SetObjectTransform theInkTransform
    Form1.Refresh
End Sub

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

Applies To