WPF LinearGradientBrush立体效果

WPF LinearGradientBrush立体效果

渐变方向

  1. 默认是左上角到右下角

2.从左到右

复制代码
<Border Height="35" Width="120">
    <Border.Background>
        <LinearGradientBrush EndPoint="1,0">
            <GradientStop Color="Yellow"
              Offset="0.1" />
            <GradientStop Color="Green"
              Offset="1.0" />
        </LinearGradientBrush>
    </Border.Background>
</Border>

效果:

3.人上到下

复制代码
<Border Height="35" Width="120">
    <Border.Background>
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="Yellow"
              Offset="0.1" />
            <GradientStop Color="Green"
              Offset="1.0" />
        </LinearGradientBrush>
    </Border.Background>
</Border>

效果:

4.立体效果

复制代码
<Border Height="35" Width="120">
    <Border.Background>
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="#FFE8A6" Offset="0.07" />
            <GradientStop Color="#FFFAEA" Offset="0.1" />
            <GradientStop Color="#FFFAEA" Offset="0.4" />
            <GradientStop Color="#FFE8A6" Offset="0.5" />
        </LinearGradientBrush>
    </Border.Background>
    <TextBlock Text="功率循环" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"/>
</Border>

效果:

相关推荐
im_AMBER12 分钟前
数据结构 06 线性结构
数据结构·学习·算法
新子y15 分钟前
【小白笔记】最大交换 (Maximum Swap)问题
笔记·python
你要飞4 小时前
Hexo + Butterfly 博客添加 Live2D 看板娘指南
笔记
Main. 247 小时前
从0到1学习Qt -- 创建第一个Hello World项目
学习
壹号用户7 小时前
python学习之生成器&三者关系
学习
new coder7 小时前
[c++语法学习]Day10:c++引用
开发语言·c++·学习
星域智链7 小时前
宠物智能用品:当毛孩子遇上 AI,是便利还是过度?
人工智能·科技·学习·宠物
ajsbxi7 小时前
【Java 基础】核心知识点梳理
java·开发语言·笔记
呱呱巨基8 小时前
vim编辑器
linux·笔记·学习·编辑器·vim
新子y8 小时前
【小白笔记】普通二叉树(General Binary Tree)和二叉搜索树的最近公共祖先(LCA)
开发语言·笔记·python