TextEffect 생성자

정의

TextEffect 클래스의 새 인스턴스를 초기화합니다.

오버로드

TextEffect()

TextEffect 클래스의 새 인스턴스를 초기화합니다.

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

클래스 속성 값을 지정하여 TextEffect 클래스의 새 인스턴스를 초기화합니다.

TextEffect()

TextEffect 클래스의 새 인스턴스를 초기화합니다.

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

예제

다음 코드 예제에서는 만드는 방법을 보여 줍니다.는 TextEffect속성을 설정 하 고 추가 TextEffectCollection 지정 된 텍스트 개체의 합니다.

// 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 클래스의 새 인스턴스를 초기화합니다.

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
Public Sub New (transform As Transform, foreground As Brush, clip As Geometry, positionStart As Integer, positionCount As Integer)

매개 변수

transform
Transform

Transform에 적용되는 TextEffect입니다.

foreground
Brush

Brush의 콘텐츠에 적용할 TextEffect입니다.

clip
Geometry

TextEffect의 클리핑 영역입니다.

positionStart
Int32

TextEffect를 적용할 텍스트 내의 시작 위치입니다.

positionCount
Int32

TextEffect를 적용할 텍스트 내의 위치 수입니다.

예제

다음 코드 예제를 호출 하는 방법을 보여 줍니다는 TextEffect 생성자입니다. 이 예제의 경우 있음을 합니다 transformclip 매개 변수를 설정 null해당 매개 변수 값이 필요 없기 때문입니다.

// 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)

적용 대상