TextEffect TextEffect TextEffect TextEffect Constructors

定義

オーバーロード

TextEffect() TextEffect() TextEffect()

TextEffect クラスの新しいインスタンスを初期化します。Initializes a new instance of the TextEffect class.

TextEffect(Transform, Brush, Geometry, Int32, Int32) TextEffect(Transform, Brush, Geometry, Int32, Int32) TextEffect(Transform, Brush, Geometry, Int32, Int32)

クラス プロパティの値を指定することによって、TextEffect クラスの新しいインスタンスを初期化します。Initializes a new instance of the TextEffect class by specifying class property values.

TextEffect() TextEffect() TextEffect()

TextEffect クラスの新しいインスタンスを初期化します。Initializes a new instance of the TextEffect class.

public:
 TextEffect();
public TextEffect ();
Public Sub New ()

次のコード例は、作成する方法を示します、 TextEffect、そのプロパティを設定し、追加、TextEffectCollectionの指定したテキスト オブジェクト。The following code example shows how to create a TextEffect, set its properties, and add it to the TextEffectCollection of the specified text object.

// Create and configure a simple color animation sequence.  Timespan is in 1000ns ticks.
ColorAnimation colorAnimation =
    new ColorAnimation(Colors.Maroon, Colors.White, new Duration(new TimeSpan(1000000)));
colorAnimation.AutoReverse = true;
colorAnimation.RepeatBehavior = RepeatBehavior.Forever;

// Create a new brush and apply the color animation.
SolidColorBrush solidColorBrush = new SolidColorBrush(Colors.Black);
solidColorBrush.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);

// Create a new TextEffect object. Set the foreground to the color-animated brush.
TextEffect textEffect = new TextEffect();
textEffect.Foreground = solidColorBrush;

// Apply the TextEffect to the entire range of characters.
textEffect.PositionStart = 0;
textEffect.PositionCount = int.MaxValue;

// Create a new text Run, and add the TextEffect to the TextEffectCollection of the Run.
Run flickerRun = new Run("Text that flickers...");
flickerRun.TextEffects = new TextEffectCollection();
flickerRun.TextEffects.Add(textEffect);

MyFlowDocument.Blocks.Add(new Paragraph(flickerRun));
' Create and configure a simple color animation sequence.  Timespan is in 1000ns ticks.
Dim colorAnimation As New ColorAnimation(Colors.Maroon, Colors.White, New Duration(New TimeSpan(1000000)))
colorAnimation.AutoReverse = True
colorAnimation.RepeatBehavior = RepeatBehavior.Forever

' Create a new brush and apply the color animation.
Dim solidColorBrush As New SolidColorBrush(Colors.Black)
solidColorBrush.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation)

' Create a new TextEffect object. Set the foreground to the color-animated brush.
Dim textEffect As New TextEffect()
textEffect.Foreground = solidColorBrush

' Apply the TextEffect to the entire range of characters.
textEffect.PositionStart = 0
textEffect.PositionCount = Integer.MaxValue

' Create a new text Run, and add the TextEffect to the TextEffectCollection of the Run.
Dim flickerRun As New Run("Text that flickers...")
flickerRun.TextEffects = New TextEffectCollection()
flickerRun.TextEffects.Add(textEffect)

MyFlowDocument.Blocks.Add(New Paragraph(flickerRun))

TextEffect(Transform, Brush, Geometry, Int32, Int32) TextEffect(Transform, Brush, Geometry, Int32, Int32) TextEffect(Transform, Brush, Geometry, Int32, Int32)

クラス プロパティの値を指定することによって、TextEffect クラスの新しいインスタンスを初期化します。Initializes a new instance of the TextEffect class by specifying class property values.

public:
 TextEffect(System::Windows::Media::Transform ^ transform, System::Windows::Media::Brush ^ foreground, System::Windows::Media::Geometry ^ clip, int positionStart, int positionCount);
public TextEffect (System.Windows.Media.Transform transform, System.Windows.Media.Brush foreground, System.Windows.Media.Geometry clip, int positionStart, int positionCount);
new System.Windows.Media.TextEffect : System.Windows.Media.Transform * System.Windows.Media.Brush * System.Windows.Media.Geometry * int * int -> System.Windows.Media.TextEffect

パラメーター

transform
Transform Transform Transform Transform

Transform に適用される TextEffectThe Transform that is applied to the TextEffect.

foreground
Brush Brush Brush Brush

Brush のコンテンツに適用する TextEffectThe Brush to apply to the content of the TextEffect.

clip
Geometry Geometry Geometry Geometry

TextEffect のクリッピング領域。The clipping region of the TextEffect.

positionStart
Int32 Int32 Int32 Int32

TextEffect の適用対象となるテキスト内の開始位置。The starting position in the text that the TextEffect applies to.

positionCount
Int32 Int32 Int32 Int32

TextEffect の適用対象となるテキスト内の位置の数。The number of positions in the text that the TextEffect applies to.

次のコード例を呼び出す方法を示しています、TextEffectコンス トラクター。The following code example shows how to call the TextEffect constructor. この場合、注意、transformclipパラメーターに設定されてnull、これらのパラメーター値が不要なためです。Notice that in this case, the transform and clip parameters are set to null, since those parameters values are not needed.

// Create a new TextEffect object, setting only the foreground brush, position start, and position count.
TextEffect textEffect = new TextEffect(null, solidColorBrush, null, 0, int.MaxValue);
' Create a new TextEffect object, setting only the foreground brush, position start, and position count.
Dim textEffect As New TextEffect(Nothing, solidColorBrush, Nothing, 0, Integer.MaxValue)

適用対象