使用线性渐变颜色填充矩形
2013-08-13 23:18
288 查看
<Page x:Class="使用线性渐变颜色填充矩形.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" WindowTitle="使用线性渐变颜色填充矩形"> <StackPanel Orientation="Horizontal"> <!--默认从左上角到右下角--> <Rectangle Width="75" Height="75" Margin="10"> <Rectangle.Fill> <LinearGradientBrush> <GradientStop Color="Yellow" Offset="0.0"/> <GradientStop Color="Orange" Offset="0.5"/> <GradientStop Color="red" Offset="1.0"/> </LinearGradientBrush> </Rectangle.Fill> </Rectangle> <!--从左下角到右上角--> <Rectangle Width="75" Height="75" Margin="10"> <Rectangle.Fill> <LinearGradientBrush StartPoint="0,1" EndPoint="1,0"> <GradientStop Color="LightSkyBlue" Offset="0.0"/> <GradientStop Color="SkyBlue" Offset="0.5"/> <GradientStop Color="Blue" Offset="1.0"/> </LinearGradientBrush> </Rectangle.Fill> </Rectangle> <!--从上到下--> <Rectangle Width="75" Height="75" Margin="10"> <Rectangle.Fill> <LinearGradientBrush StartPoint="1,0" EndPoint="1,1"> <GradientStop Color="Yellow" Offset="0.0"/> <GradientStop Color="Orange" Offset="0.5"/> <GradientStop Color="Red" Offset="1.0"/> </LinearGradientBrush> </Rectangle.Fill> </Rectangle> <!--从左到右--> <Rectangle Width="75" Height="75" Margin="10"> <Rectangle.Fill> <LinearGradientBrush StartPoint="0,1" EndPoint="1,1"> <GradientStop Color="LightSkyBlue" Offset="0.0"/> <GradientStop Color="SkyBlue" Offset="0.5"/> <GradientStop Color="Blue" Offset="1.0"/> </LinearGradientBrush> </Rectangle.Fill> </Rectangle> </StackPanel> </Page>
相关文章推荐
- 关于python使用cv画矩形并填充颜色同时填充文字
- 关于python 和C++使用cv画矩形并填充颜色同时填充文字
- IOS中使用CGContext画图填充渐变颜色图层
- Winform 创建自定义控件:使用2种半透明的颜色来填充Button
- 黑色透明png使用其他颜色填充(PPC或windows)
- 在YUV帧图像上使用指定颜色画一个矩形
- 使用RGB值填充窗口背景 设置字体颜色
- 使用CreatePatternBrush,用位图填充一个矩形区域,出现交错问题??
- j2me学习笔记【13】——创建矩形框、圆角矩形以及填充颜色小例子
- 使用画笔填充矩形
- UIButton的resizableImageWithCapInsets使用解析--拉伸模式,通过拉伸UIEdgeInsets指定的矩形区域来填充图片
- python下使用cv2.drawContours填充轮廓颜色
- 使用Drawble文件实现圆角,填充颜色,边框等属性的设置(Android)
- 使用NSMutableAttributedString添加下划线、删除线、阴影、填充、不同字体颜色等
- matlab使用imhist、plot、fill画可填充颜色连续直方图
- Python3 Tkinter基础 Canvas 使用coords移动一条直线,itemconfig设置矩形的颜色,delete删除一条直线
- H5学习之8 canvas的运用3 填充线性渐变颜色
- 使用代码修改shape的填充颜色solid
- C#用自定义或指定颜色填充矩形
- 使用 Shader 填充颜色