wpf CombinedGeometry 例子
XAML <Grid> <!-- 滚动条背景 --> <Rectangle x:Name="BackgroundRect" Width="400" Height="14" Fill="LightGray" /> <!-- 滑轨的…
|
51
|
|
63 字
|
4 分钟
wpf 显示 歌词进度
使用2色的线性背景画刷,设置动画调整颜色的中心点 XAML <Window x:Class="WpfDemoApp.LyricCtrls.LyricWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmln…
|
38
|
|
111 字
|
5 分钟
wpf 聊天气泡控件
原理同 android .9.png, 将一个图片切成 9 个部分,进行显示 # Viewbox 取源图片中的哪一部分进行显示 x, y, width, height # Viewport 显示在目标元素的哪一部分 x, y, width, height <ImageBrush ImageSource="/Resource/Imag…
|
39
|
|
194 字
|
9 分钟
wpf 弹性窗口
XAML <Window Width="400" Height="250" AllowsTransparency="True" Background="WhiteSmoke" RenderTransformOrigin="0.5 0.5" Wi…
|
44
|
|
66 字
|
4 分钟
wpf 渲染事件
代码 private void MoveCarWindow_OnLoaded(object sender, RoutedEventArgs e) { this.lastRenderingTime = TimeSpan.Zero; // 订阅渲染事件, 在对象呈现到合成树之前即发生。 CompositionTarget.Rendering += th…
|
37
|
|
101 字
|
5 分钟
wpf 自定义切换开关
日夜切换开关 代码见例子库中的 VickyThemeSwitchCtrls XAML <Grid> <Grid.Resources> <Style TargetType="ToggleButton"> <Setter Property="Background" Val…
|
57
|
|
79 字
|
4 分钟
wpf 滑出侧边栏
XAML <Grid> <Grid.Resources> <!-- 弹出边框动画, 边框宽度增加,背景蒙板显示 --> <Storyboard x:Key="ShowSide"> <DoubleAnimation Storyboard.TargetName="Sid…
|
44
|
|
115 字
|
6 分钟
wpf 地球旋转(向量计算)
代码 # loaded 时计算地球公转的地球中心 // 使用向量法计算太阳相对于地球的中心 var point = this.GetRotateTransformCenterWithTranslatePoint(); // 使用 TranslatePoint 法计算太阳相对于地球的中心 var checkPoint = this.GetRotate…
|
52
|
|
154 字
|
8 分钟
wpf 向量计算
xaml <Grid> <!-- 坦克图片,RenderTransformOrigin 设置中心点为 .5 .5 --> <Rectangle x:Name="TankRectangle" Width="240" Height="120" RenderTran…
|
66
|
|
165 字
|
8 分钟
wpf 水波纹按钮
模板 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wa…
|
44
|
|
125 字
|
6 分钟