关于canvas里面的元素超过容器大小而显示的问题
其中的重点就是用clip做出一个矩形将其与的部分隐藏了
·
- <Canvas x:Name="a" Background="White" Loaded="LayoutRoot_Loaded">
- <Canvas.Clip>
- <RectangleGeometry RadiusX="5" RadiusY="5" Rect="0,0, 300, 50" />
- </Canvas.Clip>
- <Canvas.Triggers>
- <EventTrigger RoutedEvent="Canvas.Loaded" >
- <BeginStoryboard>
- <Storyboard x:Name="animation" Storyboard.TargetProperty="(Canvas.Left)" RepeatBehavior="Forever" >
- <DoubleAnimation Storyboard.TargetName="ScrollingText" From="0" To="-820" Duration="0:0:20" />
- <DoubleAnimation Storyboard.TargetName="ScrollingText2" From="820" To="0" Duration="0:0:20" />
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </Canvas.Triggers>
- <TextBlock x:Name="ScrollingText" FontFamily="Comic Sans MS" FontSize="36" Foreground="Green" Text="I have downloaded the moded bios for the x200 which is revision 3.03. The new 3.05 Bios for x200 add some support for Windows 7. " />
- <TextBlock x:Name="ScrollingText2" FontFamily="Comic Sans MS" FontSize="36" Foreground="Green" Text="I have downloaded the moded bios for the x200 which is revision 3.03. The new 3.05 Bios for x200 add some support for Windows 7. " />
- </Canvas>
其中的重点就是用clip做出一个矩形将其与的部分隐藏了
更多推荐
已为社区贡献1条内容
所有评论(0)