wpf 跟随路径代码方式
使用 StrokeDashOffsetProperty 调整实线填充效果 调用 PathGeometry.GetPointAtFractionLength 获得当前坐标点及方向 xaml <Grid Loaded="FrameworkElement_OnLoaded"> <Grid.Resources> …
|
256
|
|
181 字
|
8 分钟
wpf 跟随路径动画方式
xaml <Canvas> <Canvas.Resources> <!-- 1. 定义移动的路径, 这里画了一个五角形 --> <PathGeometry x:Key="MovePathGeometry" Figures="M 175,30 L 213.88,123.63 L …
|
285
|
|
47 字
|
3 分钟
wpf 网格背景
原来使用控件,但是鼠标事件会受到子控件影响,现在改成装饰器 xaml <ctrlHelpers:GridLineDecorator> <Canvas /> </ctrlHelpers:GridLineDecorator> cs public class GridLineDecorator : Decorator …
|
300
|
|
343 字
|
16 分钟
wpf 波浪进度条
画了个正弦波图形 这里使用其它方式实现 https://www.bilibili.com/video/BV1GL411H746 ,其它 css 中也看过这个思路 xaml <Border BorderBrush="#4d4CAF50" BorderThickness="1" ClipToBounds=&…
|
308
|
|
142 字
|
6 分钟
wpf path data
<Grid TextElement.FontWeight="ExtraBold"> <Grid.Resources> <Style TargetType="Path"> <Setter Property="Stroke" Value="R…
|
114
|
|
119 字
|
5 分钟
wpf DockBar
xaml <Window ouseMove="DockBarWindow_OnMouseMove"> <Grid> <StackPanel x:Name="DockBarStackPanel" Margin="12" HorizontalAlignment=&…
|
136
|
|
70 字
|
4 分钟
wpf 鼠标动画
xaml <Grid x:Name="RootGrid" Background="#000123" /> cs private readonly DispatcherTimer time = new(); // 创建动画 private Storyboard CreateStoryBoard(Sh…
|
317
|
|
88 字
|
5 分钟
wpf 点连线
xaml <Grid Background="#000123" MouseLeftButtonDown="UIElement_OnMouseLeftButtonDown" MouseMove="UIElement_OnMouseMove" PreviewMouseLeftButton…
|
343
|
|
148 字
|
8 分钟
wpf 查看图片大图
xaml <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="240" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions>…
|
283
|
|
73 字
|
4 分钟
wpf 字符雨
XAML <Window Background="Black" Loaded="CharacterRainWindow_OnLoaded" > <StackPanel x:Name="RootStackPanel" Background="Black"…
|
344
|
|
121 字
|
6 分钟