Reflexionseffekt hinzufügen

Text mit Spiegelungseffekt erstellen

Der Spiegeleffekt fügt ein gespiegeltes Bild unterhalb des Textes hinzu und sorgt so für ein elegantes und modernes Erscheinungsbild. In IronWord, this effect is applied through the ReflectionEffect property of a TextEffect object, which can be customized or used with default settings.

To implement a reflection effect, create a TextStyle and configure its TextEffect property with a Reflection instance. The Reflection class supports default initialization, which applies standard reflection parameters suitable for most use cases. Bei benutzerdefinierten Spiegelungen können Eigenschaften wie Abstand, Unschärfe und Transparenz angepasst werden, um das Erscheinungsbild feinabzustimmen.

After defining the text style, create a Run containing your TextContent and assign the configured style to the run. Use AddChild to add the run to a paragraph, maintaining the proper document hierarchy of Document → Paragraph → Run → TextContent. Fügen Sie abschließend den Absatz zum Dokument hinzu, um den Spiegelungseffekt anzuwenden.

Code Erklärung

Lassen Sie uns ein neues Word-Dokument erstellen und Text mit einem Reflexionseffekt hinzufügen. Initially, a new WordDocument object named doc is created. A TextStyle object is then instantiated and configured to include a reflection effect by setting its TextEffect property to a new Reflection object.

To add the styled text with the reflection effect, a Paragraph is created, then a Run object is created containing TextContent with "Hello World". The TextStyle is assigned to the Run, applying the reflection effect. The Run is added to the Paragraph using AddChild, and the Paragraph is added to the document. Dies folgt der Dokumenthierarchie: Dokument → Absatz → Textabschnitt → Textinhalt. Schließlich wird das Dokument gespeichert.

Erkunden Sie die Dokumentelemente in den IronWord-Tutorials.

Bereit anzufangen?
Nuget Downloads 36,374 | Version: 2026.3 gerade veröffentlicht
Still Scrolling Icon

Scrollst du immer noch?

Sie brauchen schnell einen Beweis? PM > Install-Package IronWord
Führen Sie ein Beispiel aus und sehen Sie zu, wie aus Ihren Daten ein Word-Dokument wird.