Freigeben über


Translate Method (Automation Only)

Translate Method (Automation Only)

Applies a translation to a transform.

Declaration

[C++]

        HRESULT Translate (
    [in] float HorizontalComponent,
    [in] float VerticalComponent
);
      

[Microsoft® Visual Basic® 6.0]

        Public Sub Translate( _
    HorizontalComponent As Single, _
    VerticalComponent As Single _
)
      

Parameters

HorizontalComponent

[in] The horizontal component of the translation.

VerticalComponent

[in] The vertical component of the translation.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER A parameter contained an invalid pointer.
E_UNEXPECTED Unexpected parameter or property type.
E_INVALIDARG Invalid argument.
E_INK_EXCEPTION An exception occurred inside the method.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example calls Transform on the strokes in the ink in the InkCollector in the event handler for a command button to translate the strokes by 1000 horizontally and -500 vertically in ink space.

        Option Explicit
Dim theInkCollector As InkCollector

Private Sub Translate_Click()
    Dim theInkTransform As New InkTransform
    theInkTransform.Translate 1000!, -500!
    theInkCollector.Ink.Strokes.Transform theInkTransform, False
    Form1.Refresh
End Sub

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

Applies To