use*_*530 4 wpf formatting text textblock
我想在不更改文本块的字体大小的情况下拉伸WPF Textblock中的文本?
使用布局或渲染变换根据您的需要在X或Y方向缩放文本
LayoutTransform导致在布局传递之前应用缩放,这意味着渲染元素时会考虑缩放的大小.然而,RenderTransform在布局传递之后应用缩放,因此元素以正常大小间隔,然后应用缩放.
就像是
<TextBlock Text="Foo">
<TextBlock.RenderTransform>
<ScaleTransform ScaleX="2" ScaleY="2" />
</TextBlock.RenderTransform>
</TextBlock>
Run Code Online (Sandbox Code Playgroud)