Share via


Strokes.Shear Method

Shears the Strokes collection by the specified horizontal and vertical factors.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public Sub Shear ( _
    shearX As Single, _
    shearY As Single _
)
'Usage
Dim instance As Strokes 
Dim shearX As Single 
Dim shearY As Single

instance.Shear(shearX, shearY)
public void Shear(
    float shearX,
    float shearY
)
public:
void Shear(
    float shearX, 
    float shearY
)
public function Shear(
    shearX : float, 
    shearY : float
)

Parameters

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.

Examples

In this example, a horizontal shear of 0.5 is applied to the Strokes collection of an InkOverlay object.

' Access to the Strokes property returns a copy of the Strokes object. 
' This copy must be implicitly (via using statement) or explicitly 
' disposed of in order to avoid a memory leak. 
Using allStrokes As Strokes = mInkOverlay.Ink.Strokes
    allStrokes.Shear(0.5F, 0.0F)
End Using
// Access to the Strokes property returns a copy of the Strokes object. 
// This copy must be implicitly (via using statement) or explicitly 
// disposed of in order to avoid a memory leak. 
using (Strokes allStrokes = mInkOverlay.Ink.Strokes)
{
    allStrokes.Shear(0.5f, 0.0f);
}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

Strokes Class

Strokes Members

Microsoft.Ink Namespace

Stroke.Shear