InkPresenterRuler InkPresenterRuler InkPresenterRuler InkPresenterRuler Class

Definition

Represents a visual stencil, in the form of a straight rule for drawing straight lines, displayed as a semi-transparent overlay on an InkCanvas.

The stencil transforms how an ink stroke is rendered:

  • It snaps the ink stroke to the stencil edge if the pen tip is within a distance threshold (gutter).
  • It acts as a mask and prevents the drawing of an ink stroke within the area obscured by the stencil.

The InkPresenterRuler can be manipulated both programmatically and by the user. It also scales and translates with the InkCanvas.

public : sealed class InkPresenterRuler : IInkPresenterRuler, IInkPresenterRuler2, IInkPresenterStencilpublic sealed class InkPresenterRuler : IInkPresenterRuler, IInkPresenterRuler2, IInkPresenterStencilPublic NotInheritable Class InkPresenterRuler Implements IInkPresenterRuler, IInkPresenterRuler2, IInkPresenterStencil// This API is not available in Javascript.
Attributes
Windows 10 requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

The opacity of the stencil is set at 75% when static, and 50% during manipulation.

Constructors

InkPresenterRuler(InkPresenter) InkPresenterRuler(InkPresenter) InkPresenterRuler(InkPresenter) InkPresenterRuler(InkPresenter)

Initializes a new instance of the InkPresenterRuler class.

public : InkPresenterRuler(InkPresenter inkPresenter)public InkPresenterRuler(InkPresenter inkPresenter)Public Sub New(inkPresenter As InkPresenter)// This API is not available in Javascript.
Parameters
inkPresenter
InkPresenter InkPresenter InkPresenter InkPresenter

The ink presenter associated with the pen input.

Properties

AreTickMarksVisible AreTickMarksVisible AreTickMarksVisible AreTickMarksVisible

Gets or sets whether the tick marks are displayed on the ruler stencil.

Ruler stencil

Tick marks represent the distance marks on the ruler.

public : PlatForm::Boolean AreTickMarksVisible { get; set; }public bool AreTickMarksVisible { get; set; }Public ReadWrite Property AreTickMarksVisible As bool// This API is not available in Javascript.
Value
PlatForm::Boolean bool bool bool

true, if the tick marks are visible. Otherwise, false.

The default is true.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

BackgroundColor BackgroundColor BackgroundColor BackgroundColor

Gets or sets the background color of the InkPresenterRuler.

public : Color BackgroundColor { get; set; }public Color BackgroundColor { get; set; }Public ReadWrite Property BackgroundColor As Color// This API is not available in Javascript.
Value
Color Color Color Color

The background color of the ruler as an ARGB value. The default is (255, 230, 230, 230).

See Also

ForegroundColor ForegroundColor ForegroundColor ForegroundColor

Gets or sets the color of the foreground elements on an InkPresenterRuler.

public : Color ForegroundColor { get; set; }public Color ForegroundColor { get; set; }Public ReadWrite Property ForegroundColor As Color// This API is not available in Javascript.
Value
Color Color Color Color

The foreground color of the ruler as an ARGB value. The default is (255, 0, 0, 0).

See Also

IsCompassVisible IsCompassVisible IsCompassVisible IsCompassVisible

Gets or sets whether a compass is displayed on the ruler stencil.

Ruler stencil

public : PlatForm::Boolean IsCompassVisible { get; set; }public bool IsCompassVisible { get; set; }Public ReadWrite Property IsCompassVisible As bool// This API is not available in Javascript.
Value
PlatForm::Boolean bool bool bool

true, if the compass is visible. Otherwise, false.

The default is true.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

IsVisible IsVisible IsVisible IsVisible

Gets or sets whether the InkPresenterRuler is visible.

public : PlatForm::Boolean IsVisible { get; set; }public bool IsVisible { get; set; }Public ReadWrite Property IsVisible As bool// This API is not available in Javascript.
Value
PlatForm::Boolean bool bool bool

true if the ruler is visible. Otherwise, false.

Kind Kind Kind Kind

Gets the type of stencil to display on the InkCanvas.

public : InkPresenterStencilKind Kind { get; }public InkPresenterStencilKind Kind { get; }Public ReadOnly Property Kind As InkPresenterStencilKind// This API is not available in Javascript.

Length Length Length Length

Gets or sets the length of the InkPresenterRuler.

public : double Length { get; set; }public double Length { get; set; }Public ReadWrite Property Length As double// This API is not available in Javascript.
Value
double double double double

The length in device-independent pixel (DIP).

  • Default: 1600 device-independent pixel (DIP)
  • Minimum: 300 device-independent pixel (DIP)

Transform Transform Transform Transform

Gets or sets the position and rotation angle of the ruler stencil within the 2-D coordinate space of the InkCanvas.

Both position and rotation are based on the top left corner of the ruler relative to the origin of the InkCanvas.

public : Matrix3x2 Transform { get; set; }public Matrix3x2 Transform { get; set; }Public ReadWrite Property Transform As Matrix3x2// This API is not available in Javascript.
Value
Matrix3x2 Matrix3x2 Matrix3x2 Matrix3x2

The position and angle of the ruler as a 3*2 floating point matrix.The default position is the origin of the InkCanvas. The default rotation angle is 45 degrees.

Width Width Width Width

Gets or sets the width of the InkPresenterRuler.

public : double Width { get; set; }public double Width { get; set; }Public ReadWrite Property Width As double// This API is not available in Javascript.
Value
double double double double

The width in device-independent pixels (DIPs).

  • Default: 120 DIPs
  • Minimum: 120 DIPs