画刷

来源:互联网 发布:linux杀进程 编辑:程序博客网 时间:2024/04/30 21:32

画刷的种类
1:LinearGradientBrush//线型画刷


<Button Content="画刷" Height="87" Margin="0,365,0,316" Width="334">
            <Button.Background>//声明修饰的属性
                <LinearGradientBrush>//这里用的是线性画刷
                    <GradientStop Offset="0.2" Color="Red"/>用offset属性值设置那个位置要显示的颜色,其中间部分则是渐变色;
                    <GradientStop Offset="0.5" Color="Gray"/>
                    <GradientStop Offset="1" Color="Yellow"/>
                </LinearGradientBrush>
            </Button.Background>
        </Button>
2:SolidColorBrush//实心画刷

实心画刷是设置最本质设置背景色的类,嵌套在谁的什么属性标签<solidcolorbrush color="red"/>;简单的写法可直接在标签里添加相应属性的值;
3:ImageBrush
图片画刷:通过imagebrush的imagesource属性=图片路径及图片名称;