Mega Code Archive

 
Categories / C# / WPF
 

Scale the text using a ScaleTransform

<Window x:Class="SDKSample.Window1"   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   Title="Text Transform Samples"   Background="FloralWhite"   Height="640">     <StackPanel>       <TextBlock FontSize="32" FontWeight="Bold" Foreground="SteelBlue" Text="asdf" Margin="100, 0, 0, 0">         <TextBlock.RenderTransform>           <ScaleTransform ScaleX="1.5" ScaleY="1.0" />         </TextBlock.RenderTransform>       </TextBlock>       <TextBlock FontSize="32" FontWeight="Bold"  Foreground="SteelBlue"         Text="{Binding Path=Text, ElementName=textblockScaleMaster}"         Margin="100, 0, 0, 0">         <TextBlock.RenderTransform>           <ScaleTransform ScaleX="1.0" ScaleY="1.5" />         </TextBlock.RenderTransform>       </TextBlock>     </StackPanel> </Window>