Partager via


IsInverted

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

value = object.IsInverted
object.IsInverted = value

Property Value

Type: Boolean

true if the stylus is inverted; otherwise, false.

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

Managed Equivalent

Inverted

Remarks

An inverted stylus indicates erase mode. Although this property can technically be set, this is of little practical use because the StylusInfo object is merely reporting the real state of the input device.

Example

// 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

Reference