Export (0) Print
Expand All

DynamicRenderer Class

Draws ink on a surface as the user moves the tablet pen.

System.Object
  System.Windows.Input.StylusPlugIns.StylusPlugIn
    System.Windows.Input.StylusPlugIns.DynamicRenderer

Namespace:  System.Windows.Input.StylusPlugIns
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: Not mapped to an xmlns.

public class DynamicRenderer : StylusPlugIn
This class is not typically used in XAML.

The DynamicRenderer type exposes the following members.

  NameDescription
Public methodDynamicRendererInitializes a new instance of the DynamicRenderer class.
Top

  NameDescription
Public propertyDrawingAttributesGets or sets the DrawingAttributes that specifies the appearance of the rendered ink.
Public propertyElementGets the UIElement to which the StylusPlugIn is attached. (Inherited from StylusPlugIn.)
Public propertyElementBoundsGets the cached bounds of the element. (Inherited from StylusPlugIn.)
Public propertyEnabledGets or sets whether the StylusPlugIn is active. (Inherited from StylusPlugIn.)
Public propertyIsActiveForInputGets whether the StylusPlugIn is able to accept input. (Inherited from StylusPlugIn.)
Public propertyRootVisualGets the root visual for the DynamicRenderer.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Protected methodGetDispatcherReturns a Dispatcher for the rendering thread.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnAddedOccurs when the DynamicRenderer is added to an element. (Overrides StylusPlugIn.OnAdded().)
Protected methodOnDrawDraws the ink in real-time so it appears to "flow" from the tablet pen or other pointing device.
Protected methodOnDrawingAttributesReplacedOccurs when the DrawingAttributes property changes.
Protected methodOnEnabledChangedOccurs when the Enabled property changes. (Overrides StylusPlugIn.OnEnabledChanged().)
Protected methodOnIsActiveForInputChangedOccurs when the IsActiveForInput property changes. (Overrides StylusPlugIn.OnIsActiveForInputChanged().)
Protected methodOnRemovedOccurs when the StylusPlugIn is removed from an element. (Overrides StylusPlugIn.OnRemoved().)
Protected methodOnStylusDownOccurs on a thread in the pen thread pool when the tablet pen touches the digitizer. (Overrides StylusPlugIn.OnStylusDown(RawStylusInput).)
Protected methodOnStylusDownProcessedOccurs on the application UI (user interface) thread when the tablet pen touches the digitizer. (Overrides StylusPlugIn.OnStylusDownProcessed(Object, Boolean).)
Protected methodOnStylusEnterOccurs on a pen thread when the cursor enters the bounds of an element. (Overrides StylusPlugIn.OnStylusEnter(RawStylusInput, Boolean).)
Protected methodOnStylusLeaveOccurs on a pen thread when the cursor leaves the bounds of an element. (Overrides StylusPlugIn.OnStylusLeave(RawStylusInput, Boolean).)
Protected methodOnStylusMoveOccurs on a pen thread when the tablet pen moves on the digitizer. (Overrides StylusPlugIn.OnStylusMove(RawStylusInput).)
Protected methodOnStylusMoveProcessedOccurs on the application UI (user interface) thread when the tablet pen moves on the digitizer. (Inherited from StylusPlugIn.)
Protected methodOnStylusUpOccurs on a pen thread when the user lifts the tablet pen from the digitizer. (Overrides StylusPlugIn.OnStylusUp(RawStylusInput).)
Protected methodOnStylusUpProcessedOccurs on the application UI (user interface) thread when the user lifts the tablet pen from the digitizer. (Overrides StylusPlugIn.OnStylusUpProcessed(Object, Boolean).)
Public methodResetClears rendering on the current stroke and redraws it.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The DynamicRenderer class inherits from the StylusPlugIn class, and allows ink to be rendered to a surface as the user moves the mouse pointer with a tablet pen or other pointing device. You can use the DynamicRenderer to dynamically render ink on a custom control, or inherit from DynamicRenderer to perform custom rendering in real time on an ink-enabled element, such as the InkCanvas.

Dynamic rendering is done on a thread separate from the application's user interface thread when the user inputs ink with a tablet pen. When a mouse is used, dynamic rendering is done on the UI thread.

NoteNote

In order to reference this class as a XAML element, you must map the System.Windows.Input.StylusPlugins CLR namespace to a prefix, and use that prefix to qualify the DynamicRenderer element. For details, see XAML Namespaces and Namespace Mapping for WPF XAML.

The following example demonstrates how to attach a DynamicRenderer to an InkPresenter. To create a control that dynamically renders ink, see Creating an Ink Input Control.

// Create a DrawingAttributes to use for the  
// DynamicRenderer.
DrawingAttributes inkDA = new DrawingAttributes();
inkDA.Width = 5;
inkDA.Height = 5;
inkDA.Color = Colors.Purple;

// Add a dynamic renderer plugin that  
// draws ink as it "flows" from the stylus
DynamicRenderer dynamicRenderer1 = new DynamicRenderer();
dynamicRenderer1.DrawingAttributes = inkDA;

this.StylusPlugIns.Add(dynamicRenderer1);
inkPresenter1.AttachVisuals(dynamicRenderer1.RootVisual,
    dynamicRenderer1.DrawingAttributes);

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft