テキストにグロー効果を加える方法
文字のグロー効果は、文字の周りに輝くオーラを作り出す視覚効果である。 この効果により、テキストが発光しているように見え、読みやすさを向上させ、注意を引くことができるソフトな発光アウトラインを作成することができます。
IronWordの使用を開始する
今日から無料トライアルでIronWordをあなたのプロジェクトで使い始めましょう。
テキストにグロー効果を加える方法
- テキストにグロー効果を追加するC#(シーシャープ)ライブラリのダウンロード
- 新規作成または既存のテキストにテキスト効果を適用します。
- 構成する グロー オブジェクトに代入する。 テキスト効果 オブジェクト
- に割り当てる。 テキスト効果 プロパティ
- 編集したWord文書を新規ファイルとして書き出す
グロー効果を加える
テキストのグロー効果を指定するには、まずGlowオブジェクトを作成して設定します。 次に、このGlowオブジェクトからTextEffectオブジェクトを作成します。 最後に、TextEffectをテキストのTextEffectプロパティに割り当てます。
:path=/static-assets/word/content-code-examples/how-to/text-effect-glow-effect.cs
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()
{
GlowEffect = new Glow()
{
GlowColor = IronWord.Models.Color.Aqua,
GlowRadius = 10,
},
};
// Add text with style
doc.AddText("Hello World").Style = textStyle;
// Export new Word document
doc.SaveAs("glowEffect.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 {
.GlowEffect = New Glow() With {
.GlowColor = IronWord.Models.Color.Aqua,
.GlowRadius = 10
}
}
' Add text with style
doc.AddText("Hello World").Style = textStyle
' Export new Word document
doc.SaveAs("glowEffect.docx")
グロー効果の特性
以下は、すべてのグロー効果のプロパティとその説明です:
- GlowRadius :グロー効果の半径を取得または設定します。 グロー半径はポイントで指定する(1/72インチ).
- GlowColor :グロー効果の色を取得または設定します。
グロー・エフェクトの例
グロー・エフェクトの例をもう少し見てみよう。 グロー・エフェクトの色はARGB値にも対応しています。 最初の値はアルファ値で、色の不透明度を表す。