Partager via


Shear Method [IInkStrokeDisp Interface, InkStrokes Collection]

Shear Method [IInkStrokeDisp Interface, InkStrokes Collection]

Shears the ink in the stroke or strokes by the specified horizontal and vertical factors.

Declaration

[C++]

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

[Microsoft® Visual Basic® 6.0]

[Visual Basic]
Public Sub Shear( _
    shearX As Single, _
    shearY As Single _
)

Parameters

shearX

[in] The horizontal factor of the shear.

shearY

[in] 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 may not be intuitive.

This method throws an exception if the shear is non-invertible. The shear is non-invertible if the product of the shearX and shearY parameters equals 1.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example applies a horizontal shear of 0.5 to the InkStrokes collection in the InkCollector, theInkCollector, when the button, theButton, is clicked.

[Visual Basic]
Option Explicit
Dim theInkCollector As InkCollector

Private Sub theButton_Click()
    theInkCollector.Ink.Strokes.Shear 0.5!, 0!
    theForm.Refresh
End Sub

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

Applies To