Share via


Shear Method [InkTransform] (Automation Only)

Shear Method [InkTransform] (Automation Only)

Adjusts the shear of the InkTransform by the specified horizontal and vertical factors.

Declaration

[C++]

        HRESULT Shear (
    [in] float shearX,
    [in] float shearY
);
      

[Microsoft® Visual Basic® 6.0]

        Public Sub Shear( _
    shearX As Single, _
    shearY As Single _
)
      

Parameters

shearX

[in] Specifies the horizontal factor of the shear.

shearY

[in] Specifies the vertical factor of the shear.

Return Value

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

Remarks

The transformation applied in this method is a pure shear only if one of the parameters is 0. Applied to a rectangle at the origin, when the shearY factor is 0, the transformation moves the bottom edge horizontally by shearX times the height of the rectangle. When the shearX factor is 0, it moves the right edge vertically by shearY times the width of the rectangle.

Note: When both parameters are nonzero, the results are difficult to predict. For example, if both factors are 1, the transformation squeezes the entire plane to a single line.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example takes the InkRenderer object in the InkCollector theInkCollector and applies a horizontal shear of 0.5 to it, when a command button is clicked.

Option Explicit
Dim theInkCollector As InkCollector

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