## ccx_john的专栏

### Freezable 功能

LinearGradientBrush is a type of Freezable object and therefore can be frozen to improve performance." data-guid="9dfc8569a2fb7ff31408770d68e26ccf">LinearGradientBrush 是一种 Freezable 对象，因此可以将其冻结以提高性能。 Freezable features, such as freezing and cloning, see Freezable Objects Overview." data-guid="da9973886bc800bd65c5b2f3a4d54934">有关 Freezable 功能（例如冻结和克隆）的信息，请参见 Freezable 对象概述

LinearGradientBrush class to paint an area with a linear gradient." data-guid="98faeabb3a5ec42ccfa9ebaad548baf9">本示例演示如何使用 LinearGradientBrush 类来绘制带有线性渐变的区域。 Fill of a Rectangle is painted with a diagonal linear gradient that transitions from yellow to red to blue to lime green." data-guid="dde03396b3686b1578b579503a4aad72">在下面的示例中，Rectangle  Fill 是用从黄色依次过渡到红色、蓝色和浅绿色的对角线性渐变来绘制的。

<!-- This rectangle is painted with a diagonal linear gradient. -->
<Rectangle Width="200" Height="100">
<Rectangle.Fill>
</Rectangle.Fill>
</Rectangle>


Rectangle diagonalFillRectangle = new Rectangle();
diagonalFillRectangle.Width = 200;
diagonalFillRectangle.Height = 100;

// Create a diagonal linear gradient with four stops.

// Use the brush to paint the rectangle.



StartPoint and EndPoint of the LinearGradientBrush to (0,0.5) and (1,0.5)." data-guid="fc681462a9ebd62c3282081e16210388">若要创建水平线性渐变，请将 LinearGradientBrush  StartPoint  EndPoint 分别改为 (0,0.5) 和 (1,0.5)。 Rectangle is painted with a horizontal linear gradient." data-guid="735abd2c241f9ad0b75cfdcacf61e441">在下面的示例中，Rectangle 是用水平线性渐变来绘制的。

<!-- This rectangle is painted with a horizontal linear gradient. -->
<Rectangle Width="200" Height="100">
<Rectangle.Fill>
</Rectangle.Fill>
</Rectangle>


            Rectangle horizontalFillRectangle = new Rectangle();
horizontalFillRectangle.Width = 200;
horizontalFillRectangle.Height = 100;

// Create a horizontal linear gradient with four stops.

// Use the brush to paint the rectangle.



StartPoint and EndPoint of the LinearGradientBrush to (0.5,0) and (0.5,1)." data-guid="f5e3e01d8edc9184ce6d5671d9b8a607">若要创建垂直线性渐变，请将 LinearGradientBrush  StartPoint  EndPoint 分别改为 (0.5,0) 和 (0.5,1)。 Rectangle is painted with a vertical linear gradient." data-guid="e0fe6c0a0d122b67fdd09900aae576cd">在下面的示例中，Rectangle 是用垂直线性渐变来绘制的。

<!-- This rectangle is painted with a vertical gradient. -->
<Rectangle Width="200" Height="100">
<Rectangle.Fill>
</Rectangle.Fill>
</Rectangle>


Rectangle verticalFillRectangle = new Rectangle();
verticalFillRectangle.Width = 200;
verticalFillRectangle.Height = 100;

// Create a vertical linear gradient with four stops.

// Use the brush to paint the rectangle.



 此主题中的示例使用默认坐标系来设置起点和终点。 默认坐标系是相对于边界框的：0 表示边界框的 0%，1 表示边界框的 100%。 MappingMode property to the value BrushMappingMode.Absolute." data-guid="00c8ee91df694de604fbc1783e2d2951">可以通过将 MappingMode 属性设置为值 BrushMappingMode.Absolute 来更改此坐标系。 绝对坐标系与边界框不相关。 值直接在本地坐标系中解释。

Brushes Sample." data-guid="da7e90db39d227769799084a3cc70645">有关其他示例，请参见 Brushes Sample（画笔示例）。 Painting with Solid Colors and Gradients Overview." data-guid="5443f3d9e5f5ad23c2cfb724638a7555">有关渐变以及其他类型的画笔的更多信息，请参见使用纯色和渐变进行绘制概述

2013-05-14 19:56:20

#### GDI+ for VCL基础 -- 画刷之LinearGradientBrush

2007-12-14 23:37:00

2012-07-16 18:08:40

2015-10-14 10:53:04

2010-04-06 02:30:00

2008-12-11 17:17:00

2013-10-04 01:49:01

#### 使用渐变画笔填充形状

2009-09-29 14:09:00

#### GDI+学习记录(13)-线性渐变画刷 LinearGrandientBrush

2012-09-21 12:17:20

#### Direct2D 第4篇 渐变画刷

2015-12-20 21:32:23