zoukankan      html  css  js  c++  java
  • vs2010 学习Silverlight学习笔记(22):Brush填充

    概要:

           学习五种填充方式:

    SolidColorBrush、 LinearGradientBrush、RadialGradientBrush、ImageBrush、VideoBrush

    内容:

           SolidColorBrush:

    <Rectangle StrokeThickness="3" Stroke="Red"Width="100" Height="100"

                       Canvas.Left="10"Canvas.Top="10">

               <Rectangle.Fill>

                    <SolidColorBrushColor="Orange"Opacity="0.5">

                    </SolidColorBrush>

               </Rectangle.Fill>

           </Rectangle>

           LinearGradientBrush:

                  <RectangleStrokeThickness="3" Stroke="Red" Width="100"Height="100"

                       Canvas.Left="10"Canvas.Top="10">

               <Rectangle.Fill>

                    <SolidColorBrushColor="Orange"Opacity="0.5">

                    </SolidColorBrush>

               </Rectangle.Fill>

           </Rectangle>

           RadiaGradientBrush:

                  <RectangleStroke="red" StrokeThickness="3" Width="100"Height="100"

                       Canvas.Left="10"Canvas.Top="150">

               <Rectangle.Fill>

                    <RadialGradientBrushGradientOrigin="0.5,0.5" Center="0.5,0.5"

                                         RadiusX="0.5"RadiusY="0.5">

                        <GradientStopColor="#FBFE03" Offset="0.0"></GradientStop>

                        <GradientStopColor="#41F702"Offset="0.25"></GradientStop>

                        <GradientStopColor="#FF0000" Offset="0.75"></GradientStop>

                        <GradientStopColor="#0066FF" Offset="1.0"></GradientStop>

                    </RadialGradientBrush>

               </Rectangle.Fill>

           </Rectangle>

           ImageBrush:

                  <RectangleStroke="Black" StrokeThickness="3" Width="100"Height="100"

                       Canvas.Left="150"Canvas.Top="150">

               <Rectangle.Fill>

                    <ImageBrushImageSource="/SLDemo27Brush;component/LiveSearch.png"></ImageBrush>

               </Rectangle.Fill>

           </Rectangle>

    总结:

           常用到的会有:SolidColorBrush,LinearGradientBrush,ImageBrush

  • 相关阅读:
    浅析C# new 和Override的区别
    用流打开open office ods 文件
    两个自己写的合并GridView 行的方法
    TSQL 日期格式化
    页面刷新后滚动条定位
    解决 TextBox 的 ReadOnly 属性为 true 时,刷新页面后值丢失的方法
    Sql server 查询条件中将通配符作为文字使用
    window.open 弹出页面回写父页面值及触发父页面Button事件
    注册光标丢失的事件
    模态对话框对父页面控件回写值
  • 原文地址:https://www.cnblogs.com/yaoge/p/1822615.html
Copyright © 2011-2022 走看看