IRONSOFTWAREHOME
反射効果を追加する
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(),
};

// Create paragraph
Paragraph paragraph = new Paragraph();

// Create run with text and style
Run textRun = new Run(new TextContent("Hello World"));
textRun.Style = textStyle;

// Add run to paragraph
paragraph.AddChild(textRun);

// Add paragraph to document
doc.AddParagraph(paragraph);

// Export new Word document
doc.SaveAs("reflectionEffect.docx");
Imports IronWord
Imports IronWord.Models

' Create new Word document
Dim doc As New WordDocument()

' Create and configure text style
Dim textStyle As New TextStyle()
textStyle.TextEffect = New TextEffect() With {
    .ReflectionEffect = New Reflection()
}

' Create paragraph
Dim paragraph As New Paragraph()

' Create run with text and style
Dim textRun As New Run(New TextContent("Hello World"))
textRun.Style = textStyle

' Add run to paragraph
paragraph.AddChild(textRun)

' Add paragraph to document
doc.AddParagraph(paragraph)

' Export new Word document
doc.SaveAs("reflectionEffect.docx")
NuGet Download
PM > Install-Package IronWord
反射効果を追加する

反射効果を追加する

反射効果のあるテキストの作成

反射効果により、テキストの下に鏡像が追加され、洗練されたモダンな外観が生まれます。 IronWordでは、このエフェクトはTextEffectプロパティを通じて適用され、カスタマイズまたはデフォルト設定で使用することができます。

反射効果を実装するには、Reflectionインスタンスで設定してください。 Reflectionクラスはデフォルト初期化をサポートしており、たいていの使用ケースに適した標準的な反射パラメータを適用します。 カスタム反射の場合、距離、ぼかし、透明度などのプロパティを調整して外観を微調整できます。

テキストスタイルを定義した後、TextContentを含めて、その構成済みスタイルを実行に割り当てます。 Document → Paragraph → Run → TextContentという適切なドキュメント階層を維持しながら、AddChildを使用して実行を段落に追加します。 最後に、ドキュメントに段落を追加して、反射効果を適用します。

コードの説明

新しい Word ドキュメントを作成して、反射効果のあるテキストを追加しましょう。 当初、WordDocumentオブジェクトが作成されます。 次に、反射効果を含むように設定するため、新しいTextStyleオブジェクトがインスタンス化および設定されます。

反射効果を伴うスタイル付きテキストを追加するため、Paragraphが作成され、その後に"Hello World"というRunオブジェクトが作成されます。 反射効果を適用するため、Runに割り当てられます。 Paragraphがドキュメントに追加されます。 これは、ドキュメント階層に従います: ドキュメント → 段落 → 実行 → TextContent。 最後に、ドキュメントが保存されます。

IronWord チュートリアルでドキュメント要素を調べます。
GitHubで見る

準備はできましたか?

Nuget Downloads 56,401バージョン:2026.9リリースされたばかり

Key in blue circle

無料の30日間トライアルキーをすぐに入手してください。

Your trial license will be sent to your email address

制限なし。100% ロック解除済み。クレジットカード不要。

bullet_checkedクレジットカードやアカウントの作成は不要です。制限なし。100% ロック解除済み。クレジットカード不要。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
無料のライブデモを予約する
Booking Badge

世界中の数百万人のエンジニアから信頼されています。

ライセンスはより安く
義務のない相談を受ける
下記のフォームを記入するか、sales@ironsoftware.comにメールしてください。
あなたの詳細は常に守秘されます。
世界中の数百万人のエンジニアから信頼されています。
ライセンスはより安く
あなたの無料30日間の試用キーをすぐに入手。
クレジットカードやアカウントの作成は不要です。