- 经验
- 15
- 金币
- 29
- 游币
- 100
- 最后登录
- 2010-8-18
- 注册时间
- 2010-8-12
- 帖子
- 6
- 积分
- 19
- 阅读权限
- 10
- UID
- 3418

- 游币
- 100
- 金币
- 29
- 经验
- 15
- 积分
- 19
- 帖子
- 6
|
发表于 2010-8-18 15:05:27
|显示全部楼层
为什么MARK后的效果大小并非与实现的TEXTBLOCK一致呢?
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Class="WpfMask.Window1"
x:Name="Window"
Title="Window1"
UseLayoutRounding="True"
Width="640" Height="480">
<Window.Resources>
<VisualBrush x:Key="textBlock" Visual="{Binding ElementName=textBlock}"/>
</Window.Resources>
<Grid x:Name="LayoutRoot">
<Rectangle Fill="Blue" Margin="94,194,81,220" Stroke="Black" OpacityMask="{DynamicResource textBlock}"/>
<TextBlock x:Name="textBlock" HorizontalAlignment="Left" Margin="2,203,0,224" TextWrapping="Wrap" Text="TextBlock" FontSize="21.333" d:LayoutOverrides="Height"/>
</Grid>
</Window> |
|