zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    一次springboot applicationContext.getBean(clazz)空指针
    Dubbo返回自定义异常之UndeclaredThrowableException、InvocationTargetException
    MyBatis源码学习计划
    MySQL分组修改排序序号
    查看Linux服务器连接数,Oracle表和索引分析
    转载:查看Oracle连接数
    转载:查看ORACLE最耗时的SQL
    java 获取网络图片
    java POI html生成word(html里面带图片,Linux系统导出图片无法显示)
    java解决poi导出excel使用SXSSF时“Attempting to write a row[?] in the range [0,?]that is already written to disk.”异常
  • 原文地址:https://www.cnblogs.com/sshoub/p/2981772.html
Copyright © 2011-2022 走看看