概要:
学习五种填充方式:
SolidColorBrush、 LinearGradientBrush、RadialGradientBrush、ImageBrush、VideoBrush
内容:
SolidColorBrush:
<Rectangle StrokeThickness="3" Stroke="Red"Width="100" Height="100"
Canvas.Left="10"Canvas.Top="10">
<Rectangle.Fill>
<SolidColorBrushColor="
</SolidColorBrush>
</Rectangle.Fill>
</Rectangle>
LinearGradientBrush:
<RectangleStrokeThickness="3" Stroke="Red" Width="100"Height="100"
Canvas.Left="10"Canvas.Top="10">
<Rectangle.Fill>
<SolidColorBrushColor="
</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="#
<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