15.02.2015 Views

C# 4 and .NET 4

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Text elements ❘ 1077<br />

Running the application, you get a large list of system font families with italic, bold, ultrabold, <strong>and</strong> ultralight<br />

characteristics, as shown in Figure 37-1.<br />

figure 37-1<br />

Texteffect<br />

Next let’s have a look into TextEffect, as it is also common to all document elements. TextEffect is<br />

defined in the namespace System.Windows.Media <strong>and</strong> derives from the base class Animatable that allows<br />

animation of text.<br />

TextEffect allows you to animate a clipping region, the foreground brush, <strong>and</strong> a transformation. With<br />

the properties PositionStart <strong>and</strong> PositionCount you specify the position in the text the animation<br />

applies to.<br />

For applying the text effects, the TextEffects property of a Run element is set. The TextEffect<br />

element specified within the property defines a foreground <strong>and</strong> a transformation. For the foreground, a<br />

SolidColorBrush with the name brush1 is used that is animated with a ColorAnimation element. The<br />

transformation makes use of ScaleTransformation with the name scale1 that is animated from two<br />

DoubleAnimation elements:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

cn|elements<br />

<br />

<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!