Solid color is the simplest type of fill effect. Changing the color of an object with an assigned FillEffect is done with only one function call:
VB.NET | |
---|---|
fillEffect.SetSolidColor(Color.Green) |
C# | |
---|---|
fillEffect.SetSolidColor(Color.Green); |
The SetSolidColor function actually performs three steps. First, it changes the color property of the FillEffect object to green. Next, it changes the type of the fill effect to color. Finally, it modifies the material properties of the object so that it will also look green when you apply a lighting effect to the scene. Lighting and material properties are discussed in detail in the Lighting topics in the Users Guide and are beyond the scope of this topic.
As you can guess, you can perform all of these steps manually:
VB.NET | |
---|---|
|
C# | |
---|---|
|
This approach however is not recommended because it requires an additional function call and does not update some of the attached material properties.
Let's illustrate the above with a few simple code examples:
VB.NET | |
---|---|
|
C# | |
---|---|
|
Related Examples
Windows Forms: Fill Effects\General