InkPresenter.AttachVisuals(Visual, DrawingAttributes) InkPresenter.AttachVisuals(Visual, DrawingAttributes) InkPresenter.AttachVisuals(Visual, DrawingAttributes) Method

Définition

Attache le visuel d'un DynamicRenderer à un InkPresenter.Attaches the visual of a DynamicRenderer to an InkPresenter.

public:
 void AttachVisuals(System::Windows::Media::Visual ^ visual, System::Windows::Ink::DrawingAttributes ^ drawingAttributes);
public void AttachVisuals (System.Windows.Media.Visual visual, System.Windows.Ink.DrawingAttributes drawingAttributes);
member this.AttachVisuals : System.Windows.Media.Visual * System.Windows.Ink.DrawingAttributes -> unit

Paramètres

visual
Visual Visual Visual

Visuel du DynamicRenderer.The visual of a DynamicRenderer.

drawingAttributes
DrawingAttributes DrawingAttributes DrawingAttributes

DrawingAttributes qui spécifie l'apparence de l'encre restituée de façon dynamique.The DrawingAttributes that specifies the appearance of the dynamically rendered ink.

Exceptions

visual est déjà attaché à une arborescence visuelle.visual is already attached to a visual tree.

Exemples

L’exemple suivant montre comment attacher le visuel et DrawingAttributes d’un DynamicRenderer à un InkPresenter.The following example demonstrates how to attach the visual and DrawingAttributes of a DynamicRenderer to an InkPresenter.

// 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);
' Create a DrawingAttributes to use for the 
' DynamicRenderer.
Dim inkDA As 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
Dim dynamicRenderer1 As New DynamicRenderer()
dynamicRenderer1.DrawingAttributes = inkDA

Me.StylusPlugIns.Add(dynamicRenderer1)
inkPresenter1.AttachVisuals(dynamicRenderer1.RootVisual, dynamicRenderer1.DrawingAttributes)

Remarques

Attachez le visuel d' DynamicRenderer un InkPresenter au pour afficher dynamiquement de l’encre sur votre contrôle.Attach the visual of a DynamicRenderer to the InkPresenter to dynamically render ink on your control.

S’applique à