添加反射效果
讓我們創建一個新的 Word 文件並為其添加帶有反射效果的文字。 首先,創建了一個名為 doc 的新 WordDocument 對象。 然後實例化一個 TextStyle 物件,並透過將其 TextEffect 屬性設置為新的 Reflection 物件以包含反射效果。 帶有反射效果的“Hello World”樣式文字已添加到文件中。 最後,文件已儲存。 如需更多範例和示範,請瀏覽以下文章:如何為文字添加反射效果。
using IronWord;
using IronWord.Models;
// Create new Word document
WordDocument doc = new WordDocument();
// Create and configure text style
TextStyle textStyle = new TextStyle();
textStyle.TextEffect = new TextEffect()
{
ReflectionEffect = new Reflection(),
};
// Add text with style
doc.AddText("Hello World").Style = textStyle;
// Export new Word document
doc.SaveAs("reflectionEffect.docx");Imports IronWord
Imports IronWord.Models
' Create new Word document
Private doc As New WordDocument()
' Create and configure text style
Private textStyle As New TextStyle()
textStyle.TextEffect = New TextEffect() With {.ReflectionEffect = New Reflection()}
' Add text with style
doc.AddText("Hello World").Style = textStyle
' Export new Word document
doc.SaveAs("reflectionEffect.docx")Install-Package IronWord
讓我們創建一個新的 Word 文件並為其添加帶有反射效果的文字。 首先,創建了一個名為 doc 的新 WordDocument 對象。 然後實例化一個 TextStyle 物件,並透過將其 TextEffect 屬性設置為新的 Reflection 物件以包含反射效果。 帶有反射效果的“Hello World”樣式文字已添加到文件中。 最後,文件已儲存。 如需更多範例和示範,請瀏覽以下文章:如何為文字添加反射效果。