テキストに反射効果を加える方法

This article was translated from English: Does it need improvement?
Translated
View the article in English

テキストのリフレクション効果とは、テキストを元の形よりも下に鏡のように映し出す視覚的強調効果です。 このエフェクトは、表面上の文字の反射をシミュレートし、しばしばデザインに深みとリアリズムを加える。

 用 C# NuGet ライブラリ

でインストール NuGet

Install-Package IronWord
 用 C# NuGet ライブラリ

でインストール NuGet

Install-Package IronWord
または
Java PDF JAR(ジャバPDF JAR)

ダウンロード DLL (ディーエルエル)

DLLをダウンロード

プロジェクトに手動でインストールする

今日からプロジェクトでIronPDFを使い始めましょう。無料のトライアルをお試しください。

最初のステップ:
green arrow pointer

チェックアウト IronWord オン Nuget 迅速なインストールと展開のために。8百万以上のダウンロード数により、をC#で変革しています。

 用 C# NuGet ライブラリ nuget.org/packages/IronWord/
Install-Package IronWord

反射効果の追加

テキストの反射効果を指定するには、TextStyle オブジェクトを作成し、ReflectionEffect プロパティに Reflection オブジェクトを指定します。 最後に、TextEffectプロパティにTextStyleオブジェクトを代入して、スタイルを持つ新しいテキストを追加します。

:path=/static-assets/word/content-code-examples/how-to/text-effect-reflection-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()
{
    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")
VB   C#
反射効果を加える

反射効果のプロパティ

リフレクション・エフェクトは、多様な設計要件を満たすために、さまざまな調整可能な属性を提供する。 各物件の詳細については、以下のリストを参照のこと:

  • SchemeColor:反射効果のスキームカラーを取得または設定します。
  • HorizontalSkewAngle:反射効果の水平スキュー角度を取得または設定します。 スキュー角は度単位で指定する。
  • HorizontalScalingFactor:反射効果の水平方向のスケーリング係数を取得または設定します。
  • DistanceFromText:テキストまたはオブジェクトからの反射効果の距離を取得または設定します。 距離はポイントで指定する。 (1/72インチ).
  • DirectionAngle:反射エフェクトの方向角度を取得または設定します。 方向角度は度単位で指定する。
  • FadeDirectionAngle:反射エフェクトのフェード方向を取得または設定します。
  • EndPosition:反射エフェクトの終了位置を取得または設定します。
  • StartPosition:反射エフェクトの開始位置を取得または設定します。
  • EndingOpacity:反射効果の終了不透明度を取得または設定します。
  • VerticalScalingFactor:反射効果の垂直方向のスケーリング係数を取得または設定します。
  • StartingOpacity:反射効果の開始不透明度を取得または設定します。
  • Alignment:反射エフェクトのアライメントを取得または設定します。
  • BlurRadius:反射効果のぼかし半径を取得または設定します。 ぼかしの半径をポイントで指定します。 (1/72インチ).
  • VerticalSkewAngle:反射エフェクトの垂直スキュー角度を取得または設定します。 スキュー角は度単位で指定する。
:path=/static-assets/word/content-code-examples/how-to/text-effect-customized-reflection-effect.cs
using IronWord;
using IronWord.Models;
using IronWord.Models.Enums;

// Create new Word document
WordDocument doc = new WordDocument();

// Create and configure text style
TextStyle textStyle = new TextStyle();
textStyle.TextEffect = new TextEffect()
{
    ReflectionEffect = new Reflection()
    {
        Alignment = RectangleAlignmentValues.BottomLeft,
        BlurRadius = 5,
        DirectionAngle = 90,
        DistanceFromText = 5,
        EndingOpacity = 100,
        EndPosition = 10,
        FadeDirectionAngle = 90,
        HorizontalScalingFactor = 100,
        HorizontalSkewAngle = 0,
        SchemeColor = IronWord.Models.Color.Gold,
        StartingOpacity = 0,
        StartPosition = 0,
        VerticalScalingFactor = -100,
        VerticalSkewAngle = 0,
    },
};

// Add text with style
doc.AddText("Customized reflection").Style = textStyle;

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

' 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() With {
		.Alignment = RectangleAlignmentValues.BottomLeft,
		.BlurRadius = 5,
		.DirectionAngle = 90,
		.DistanceFromText = 5,
		.EndingOpacity = 100,
		.EndPosition = 10,
		.FadeDirectionAngle = 90,
		.HorizontalScalingFactor = 100,
		.HorizontalSkewAngle = 0,
		.SchemeColor = IronWord.Models.Color.Gold,
		.StartingOpacity = 0,
		.StartPosition = 0,
		.VerticalScalingFactor = -100,
		.VerticalSkewAngle = 0
	}
}

' Add text with style
doc.AddText("Customized reflection").Style = textStyle

' Export new Word document
doc.SaveAs("customizedReflectionEffect.docx")
VB   C#
反射効果のカスタマイズ