Applying a RadialGradientBrush

The RadialGradientBrush brush works exactly like the LinearGradientBrush, except that it creates a circular gradient. The following code shows how it is possible to apply such a brush to an Ellipse:

image

You are not limited to the Ellipse shape, but for demo purposes it is the one that best fits the example. Figure 33.3 shows the result of the brush applied.

Figure 33.3 The result of the RadialGradientBrush.

image

The Visual Basic code for applying the brush at runtime is similar to the one for the linear gradient. The following code snippet provides an example:

image

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.160.142