Compartilhar via


Rotate Method [InkTransform Class]

Rotate Method [InkTransform Class]

Changes the amount, measured in degrees, to change the rotation factor of the InkTransform object and optionally the center point of the rotation.

Declaration

[C++]

HRESULT Rotate (
    [in] float Degrees,
    [in, optional, defaultvalue(0)] float x,
    [in, optional, defaultvalue(0)] float y
);

[Microsoft® Visual Basic® 6.0]

Public Sub Rotate( _
    Degrees As Single, _
    [x As Single], _
    [y As Single] _
)

Parameters

Degrees

[in] The degrees by which to rotate clockwise. Without the optional x and y arguments, rotation takes place around the origin point, which by default is the upper left corner of the ink collection area to which the transform is applied.

x

[in, optional] The x-coordinate of the point in ink space coordinates around which rotation occurs.

y

[in, optional] The y-coordinate of the point in ink space coordinates around which rotation occurs.

Return Value

HRESULT value Description
S_OK Success.
E_INK_EXCEPTION An exception occurred inside the method.

Remarks

The center point defaults to the origin.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example shows a button handler that rotates the ink clockwise on the form around a point at (4000, 4000) in ink space coordinates.

Option Explicit
Dim theInkCollector As InkCollector

Private Sub Command1_Click()
    Dim theInkTransform As New InkTransform
    theInkCollector.Renderer.GetObjectTransform theInkTransform
    theInkTransform.Rotate 45!, 4000!, 4000!
    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