InkPresenter.AttachVisuals(Visual, DrawingAttributes) Methode

Definition

Fügt das visuelle Element einer an .DynamicRendererInkPresenter

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
Public Sub AttachVisuals (visual As Visual, drawingAttributes As DrawingAttributes)

Parameter

visual
Visual

Das Visuelle eines DynamicRenderer.

drawingAttributes
DrawingAttributes

Dies DrawingAttributes gibt die Darstellung der dynamisch gerenderten Freihandeingabe an.

Ausnahmen

visual ist bereits an eine visuelle Struktur angefügt.

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie sie das visuelle Element und DrawingAttributes eines elements DynamicRenderer anfügen 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)

Hinweise

Fügen Sie das visuelle Element einer DynamicRenderer Anknüpfung an das InkPresenter dynamische Rendern von Freihand in Ihrem Steuerelement an.

Gilt für: