Share via


IsInverted Property

Gets or sets a value that specifies whether the stylus is inverted.

XAML
Cannot be used in XAML.
Scripting
value = object.IsInverted
object.IsInverted = value

Property Value

Boolean

true if the stylus is inverted; otherwise, false.

This property is read/write. The default value is false.

Remarks

When the stylus is inverted, it indicates erase mode. Although the property is technically settable, this is of little practical use because the StylusInfo is merely reporting the real state of the input device.

Examples

JavaScript
// Add the new points to the Stroke we're working with
// or delete strokes if we are in erase mode
function inkPresenterMouseMove(sender, args)
{
    var stylusPoints = args.getStylusPoints(sender);
    
    // Erase Mode?
    if (lastErasePoint != null)
    {
        // connect the point from previous mouse event
        // to the current collection of stylus points
        stylusPoints.insert(0, lastErasePoint);
        var hitStrokes = sender.strokes.hitTest(stylusPoints);
        // Remove the strokes that were intersected above
        for (var i = 0; i < hitStrokes.Count; i++)
        {
          sender.strokes.remove(hitStrokes.getItem(i));
        }
        
        // update the cached last erase point
        lastErasePoint = stylusPoints.getItem(stylusPoints.count-1);
    }
    // Ink Mode?
    if (newStroke != null)
    {
        newStroke.stylusPoints.addStylusPoints(stylusPoints);
    }
}

Applies To

StylusInfo

See Also

StylusInfo