Share via


DrawingAttributes.FitToCurve Property

Gets or sets the value that indicates whether Bezier smoothing is used to render ink.

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

Syntax

'Declaration
Public Property FitToCurve As Boolean
'Usage
Dim instance As DrawingAttributes
Dim value As Boolean

value = instance.FitToCurve

instance.FitToCurve = value
public bool FitToCurve { get; set; }
public:
property bool FitToCurve {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_FitToCurve ()

/** @property */
public void set_FitToCurve (boolean value)
public function get FitToCurve () : boolean

public function set FitToCurve (value : boolean)
Not applicable.

Property Value

true if Ink is rendered as a series of curves. false if Ink is rendered as lines between pen sample points.

Remarks

Bezier smoothing is especially useful for smoothing the ink in scenarios when writing may be unsteady, such as when a user is standing.

If you set the FitToCurve property while collecting ink, the ink does not render as a series of curves until the strokes are redrawn or refreshed.

Example

This C# example uses a menu item's event handler, menuInkFitToCurve_Click, to toggle the FitToCurve property on and off.

using Microsoft.Ink;
//...
    private System.Windows.Forms.MenuItem menuInkFitToCurve;
    private InkCollector theInkCollector;
//...
    private void menuInkFitToCurve_Click(
    object sender, System.EventArgs e)
    {
        menuInkFitToCurve.Checked = ! menuInkFitToCurve.Checked;
        theInkCollector.DefaultDrawingAttributes.FitToCurve =
            menuInkFitToCurve.Checked;
        Refresh();
    }

This Microsoft® Visual Basic® .NET example uses a menu item's event handler, MenuInkFitToCurve_Click, to toggle the FitToCurve property on and off.

Imports Microsoft.Ink
'...
    Dim MenuInkFitToCurve As System.Windows.Forms.MenuItem
    Dim theInkCollector As InkCollector
'...
    Private Sub MenuInkFitToCurve_Click( _
    ByVal sender As Object, ByVal e As System.EventArgs)
        MenuInkFitToCurve.Checked = Not MenuInkFitToCurve.Checked
        theInkCollector.DefaultDrawingAttributes.FitToCurve = _
            MenuInkFitToCurve.Checked
        Refresh()
    End Sub

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

DrawingAttributes Class
DrawingAttributes Members
Microsoft.Ink Namespace
Microsoft.Ink.Stroke.GetFlattenedBezierPoints
Stroke