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);
}
public function get FitToCurve () : boolean 
public function set FitToCurve (value : boolean)

Property Value

Type: System.Boolean
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.

Examples

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

DrawingAttributes Class

DrawingAttributes Members

Microsoft.Ink Namespace

Stroke.GetFlattenedBezierPoints

Stroke