WPF模拟雷达界面效果图
原文:WPF模拟雷达界面效果图
iPad塔防的防守兵的效果很炫,2个小时用WPF模拟了一个。
效果图:
关键代码:
<Grid>
<Grid.Background>
<ImageBrush ImageSource="Koala.jpg"/>
</Grid.Background> <Button Content="Button1" HorizontalAlignment="Left" Margin="187,107,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_1"/> <Grid x:Name="m_Grid" HorizontalAlignment="Left" VerticalAlignment="Top" Height="300" Width="300" MouseUp="m_Grid_MouseUp" Margin="69,31,0,0">
<Ellipse Stroke="White" StrokeThickness="1">
<Ellipse.Fill>
<RadialGradientBrush Opacity="1" RadiusX="0.5" RadiusY="0.5" GradientOrigin="0.5,0.5">
<GradientStop Color="White" Offset="1.1" ></GradientStop>
<GradientStop Color="Transparent" Offset="0.92"></GradientStop>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
<Ellipse x:Name="m_Ellipse" Stroke="White" Margin="4">
<Ellipse.Fill>
<RadialGradientBrush Opacity="1" RadiusX="0.5" RadiusY="0.5" GradientOrigin="0.5,0.5">
<GradientStop Color="White" Offset="0.97" ></GradientStop>
<GradientStop Color="Transparent" Offset="0.96"></GradientStop>
</RadialGradientBrush>
</Ellipse.Fill>
<Ellipse.Clip>
<RectangleGeometry Rect="0,0,100,100" />
</Ellipse.Clip>
<Ellipse.RenderTransform>
<RotateTransform Angle="0" CenterX="146" CenterY="146" />
</Ellipse.RenderTransform>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever">
<DoubleAnimation Storyboard.TargetName="m_Ellipse"
Storyboard.TargetProperty="(Ellipse.RenderTransform).(RotateTransform.Angle)"
To="180"
Duration="0:0:5"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
<Ellipse x:Name="m_Ellipse2" Stroke="White" Margin="4">
<Ellipse.Fill>
<RadialGradientBrush Opacity="1" RadiusX="0.5" RadiusY="0.5" GradientOrigin="0.5,0.5">
<GradientStop Color="White" Offset="0.97" ></GradientStop>
<GradientStop Color="Transparent" Offset="0.96"></GradientStop>
</RadialGradientBrush>
</Ellipse.Fill>
<Ellipse.Clip>
<RectangleGeometry Rect="0,0,100,100" />
</Ellipse.Clip>
<Ellipse.RenderTransform>
<RotateTransform Angle="180" CenterX="146" CenterY="146" />
</Ellipse.RenderTransform>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever">
<DoubleAnimation Storyboard.TargetName="m_Ellipse2"
Storyboard.TargetProperty="(Ellipse.RenderTransform).(RotateTransform.Angle)"
To="360"
Duration="0:0:5"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse> <Button Content="PopButton" HorizontalAlignment="Left" Margin="18,126,0,0" VerticalAlignment="Top" Width="75"/>
</Grid> </Grid>
WPF模拟雷达界面效果图的更多相关文章
- 使用WPF技术模拟手机界面
原文:使用WPF技术模拟手机界面 1. 前言 WPF(Windows Presentation Foundation),即"Windows呈现基础",它的目的非常明确,就是用来把数 ...
- WPF 模拟迅雷TabControl界面
WPF模拟迅雷TabControl界面 点击查看下载 <!--TabControl样式--> <Style x:Key="TabControlStyle" Tar ...
- wpf 模拟3D效果(和手机浏览图片效果相似)(附源码)
原文 wpf 模拟3D效果(和手机浏览图片效果相似)(附源码) pf的3D是一个很有意思的东西,类似于ps的效果,类似于电影动画的效果,因为动画的效果,(对于3D基础的摄像机,光源,之类不介绍,对于依 ...
- Wix 安装部署教程(九) --用WPF做安装界面
经常安装PC端的应用,特别是重装系统之后,大致分为两类.一类像QQ,搜狗输入法这样的.分三步走的:第一个页面可以自定义安装路径和软件许可.第二个页面显示安装进度条,第三个页面推荐其他应用.先不管人家怎 ...
- WPF 模拟UI 键盘录入
原文:WPF 模拟UI 键盘录入 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/yangyisen0713/article/details/1835 ...
- WPF模拟探照灯文字
原文:WPF模拟探照灯文字 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/yangyisen0713/article/details/1835936 ...
- WPF模拟Office2010文件菜单的TabControl模板
原文:WPF模拟Office2010文件菜单的TabControl模板 这是Office2010中的文件菜单点开后的效果.本文我将以强大的WPF(www.itstrike.cn)来实现类似的效果.希望 ...
- WPF旋转的界面实现
原文:WPF旋转的界面实现 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/yangyisen0713/article/details/1821534 ...
- wpf中防止界面卡死的写法
原文:wpf中防止界面卡死的写法 ); this.Dispatcher.BeginInvoke(new Action(() => { this.button1.Content = "计 ...
随机推荐
- LeetCode题解之Number of 1 Bits
1.题目描述 2.问题分析 使用C++ 标准库的 bitset 类,将整数转换为 二进制,然后将二进制表示转换为字符串,统计字符串中 1 的个数即可. 3.代码 int hammingWeight(u ...
- 本地sql大文件导入数据库
mysql中配置my.ini interactive_timeout = 120 wait_timeout = 120 max_allowed_packet = 32M 导入sql运行命令 sourc ...
- Oracle EBS 隐藏帮助-诊断-检查
- Oracle 处理坏块
本文主要介绍如何去处理在Oracle数据库中出现坏块的问题,对于坏块产生在不同的对象上,处理的方法会有所不同,本文将大致对这些方法做一些介绍.因为数据库运行时间长了,由于硬件设备的老化,出现坏块的几率 ...
- cef开启摄像头和录音
参考资料:https://github.com/cztomczak/phpdesktop/wiki/Chrome-settings#command_line_switches CefSharp中文帮助 ...
- 关于打开现有项目时数据库连接配置遇到的问题 连接字符串中的数据源值指定未安装的SQL Server的实例。要解决此问题,可选择安装匹配的SQL Server实例或修改连接字符串中的数据源值
最近在看红皮书<ASP.NET MVC 5 高级编程>时,为了更好理解,边看书,边打开源代码查看,在VS(Visual Studio 2015)中将源代码打开,发现数据库连接是关闭的,本想 ...
- Mac环境下WingIDE切换python版本
https://www.cnblogs.com/fastLearn/p/6514442.html
- HTML5的新标签-整体布局
过去:<div class="header"> <div class="hgroup"> <h1>....</h1&g ...
- 走向Node与Webpack 之路 - CommonJS 模块化
走向Node与Webpack 之路 - CommonJS 模块化 1. 参考资料 JavaScript 标准参考教程(alpha) CommonJS规范(推荐 - 阮一峰写的) 官方网站 (看半天,不 ...
- python第二十五课——闭包
满足闭包的三个条件: 1).有外部函数和内部函数这样的结构 2).外部函数中定义的变量被内部函数所使用 3).内部函数对象作为返回值被外部函数返回 演示闭包的定义和使用: def outer(): a ...