WPF Border 妙用,切图


csharp 复制代码
<Window x:Class="WpfDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfDemo"
        mc:Ignorable="d"
              Title="Window1" Height="650" Width="650">
    <WindowChrome.WindowChrome>
        <WindowChrome NonClientFrameEdges="None" UseAeroCaptionButtons="False"/>
    </WindowChrome.WindowChrome>
    <Grid >
        <Grid.Background>
            <RadialGradientBrush GradientOrigin="0.8,0.8" 
                                 Center="0.8,0.8"
                                 RadiusX="0.7" RadiusY="1">
                <GradientStop Color="#103156" Offset="0"></GradientStop>
                <GradientStop Color="#141627" Offset="1.5"></GradientStop>
            </RadialGradientBrush>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Path Data="M0 0 0 35 200 35 
              C 210 35 210 35 218 38
              C 226 46 226 46 236 46 
              L406 46
              C414 46 414 46 422 38
              C430 35 430 35 440 35
              L640 35 640 0" >
            <Path.Fill>
                <RadialGradientBrush GradientOrigin="0.5,1.5"
                                     Center="0.5,1"
                                     RadiusX="0.12" RadiusY="0.5">
                    <GradientStop Color="#1B75E7" Offset="0"></GradientStop>
                    <GradientStop Color="#144594" Offset="0.4"></GradientStop>
                    <GradientStop Color="#0D213C" Offset="1"></GradientStop>
                </RadialGradientBrush>
            </Path.Fill>
            <Path.Stroke>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                    <GradientStop Color="Transparent" Offset="0"></GradientStop>
                    <GradientStop Color="#47D9FF" Offset=".5"></GradientStop>
                    <GradientStop Color="Transparent" Offset="1"></GradientStop>
                </LinearGradientBrush>
            </Path.Stroke>
        </Path>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition Width="auto"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <TextBlock Text="XXXXXXXXXXXXXXXX" VerticalAlignment="Center" Foreground="#9FFF" FontSize="16" Grid.Column="1" Margin="50,5,50,0"></TextBlock>
            <Border BorderBrush="#1B436E" VerticalAlignment="Center" BorderThickness="0,0,2,0" Margin="0,0,4,0" Height="14">
                <Border.RenderTransform>
                    <SkewTransform AngleX="-45"></SkewTransform>
                </Border.RenderTransform>
                <Border BorderBrush="#1B436E" BorderThickness="0,0,2,0" Margin="0,0,4,0">
                    <Border Margin="0,0,4,0">
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                <GradientStop Color="#0D213c" Offset="0"></GradientStop>
                                <GradientStop Color="#1B436E" Offset="1"></GradientStop>
                                
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>
                </Border>
            </Border>
            <Border Grid.Column="2" BorderBrush="#1B436E" VerticalAlignment="Center" BorderThickness="2,0,0,0" Margin="4,0,0,0" Height="14">
                <Border.RenderTransform>
                    <SkewTransform AngleX="-135"></SkewTransform>
                </Border.RenderTransform>
                <Border BorderBrush="#1B436E" BorderThickness="2,0,0,0" Margin="4,0,0,0">
                    <Border Margin="4,0,0,0">
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                <GradientStop Color="#1B436E" Offset="0"></GradientStop>
                                <GradientStop Color="#0D213c" Offset="1"></GradientStop>
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>
                </Border>
            </Border>
        </Grid>
    </Grid>
</Window>
相关推荐
冷眼Σ(-᷅_-᷄๑)35 分钟前
WPF缩放动画和平移动画叠加后会发生什么?
wpf·动画
△曉風殘月〆3 小时前
WPF MVVM入门系列教程(二、依赖属性)
c#·wpf·mvvm
.net开发10 小时前
WPF怎么通过RestSharp向后端发请求
前端·c#·.net·wpf
九鼎科技-Leo10 小时前
WPF 中 NavigationWindow 与 Page 的继承关系解析
wpf
SongYuLong的博客11 小时前
C# WPF 打印机
wpf
就是有点傻11 小时前
WPF中的转换器
wpf
.net开发18 小时前
WPF使用prism框架发布订阅实现消息提示
c#·.net·wpf
那少年已不再......1 天前
C#WPF使用CommunityToolkit.Mvvm库
开发语言·c#·wpf
SEO-狼术1 天前
Syncfusion Essential Studio WPF 2024 Crack
wpf
Olivia_vivi2 天前
WPF XAML
ui·wpf