SizeAnimation + TextEffect
Bonjour,
En me basant sur ce code trouvé sur MSDN, je me demandais s'il était possible de créer une animation qui modifie la taille du texte sur ce modèle :
Code:
1 2 3 4 5 6 7 8 9
| ' Create a new brush and apply the color animation.
Dim scb As New SolidColorBrush(Colors.Black)
scb.BeginAnimation(SolidColorBrush.ColorProperty, blackToWhite)
' Create a new TextEffect object; set foreground brush to the previously created brush.
Dim tfe As New System.Windows.Media.TextEffect()
tfe.Foreground = scb
' Range of text to apply effect to (all).
tfe.PositionStart = 0
tfe.PositionCount = Integer.MaxValue |
J'ai écris ce début de code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| Dim size_from As New Size
size_from.Height = 16
Dim size_to As New Size
size_to.Height = 32
Dim size_test As New SizeAnimation(size_from, size_to, New Duration(New TimeSpan(30000000)))
size_test.AutoReverse = True
size_test.RepeatBehavior = RepeatBehavior.Forever
Dim tfe_2 As New System.Windows.Media.TextEffect
tfe_2. ???
' ...
' Range of text to apply effect to (all).
tfe_2.PositionStart = 0
tfe_2.PositionCount = Integer.MaxValue |
Sur quelle propriété de l'objet TextEffect dois-je travailler ?
Comment créer des propriétés supplémentaires à un objet TextEffect ?
J'ai essayé de créer ma propre classe _TextEffect avec ce code mais je ne comprends pas ce qui se passe, d' habitude ça fonctionne l'héritage :
Code:
1 2 3 4
| Public Class _TextEffect
Inherits System.Windows.Media.TextEffect
End Class |
Merci de m'aider