| Visual Basic (Declaration) | |
|---|---|
Overloads Public Sub GradientFillRectangle( _ ByVal hdc As IntPtr, _ ByVal destRect As Rectangle, _ ByVal gradientStyle As SpecialEffectsGradientStyle, _ ByVal startColor As Color, _ ByVal endColor As Color, _ ByVal steps As Integer _ ) | |
| Visual Basic (Usage) | Copy Code |
|---|---|
| |
| C# | |
|---|---|
public void GradientFillRectangle( IntPtr hdc, Rectangle destRect, SpecialEffectsGradientStyle gradientStyle, Color startColor, Color endColor, int steps ) | |
| Managed Extensions for C++ | |
|---|---|
public: void GradientFillRectangle( IntPtr hdc, Rectangle destRect, SpecialEffectsGradientStyle gradientStyle, Color startColor, Color endColor, int steps ) | |
| C++/CLI | |
|---|---|
public: void GradientFillRectangle( IntPtr hdc, Rectangle destRect, SpecialEffectsGradientStyle gradientStyle, Color startColor, Color endColor, int steps ) | |
Parameters
- hdc
- Handle to a device context where the gradient effect will be displayed.
- destRect
- Rectangle to be used as the display destination rectangle.
- gradientStyle
- Gradient style. For possible values refer to SpecialEffectsGradientStyle.
- startColor
- Value that specifies the starting color.
- endColor
- Value that specifies the ending color.
- steps
- Number of gradient color steps. Valid values are 2 to 256.
This Example shows the minimum requirements for using the GradientFillRectangle method to draw and fill a rectangle with a color gradient.
| Visual Basic | Copy Code |
|---|---|
Public Sub GradientFillRectangle(ByVal g As Graphics, ByVal destRect As Rectangle) | |
| C# | Copy Code |
|---|---|
public void GradientFillRectangle(Graphics g, Rectangle destRect) | |
For more information, refer to Implementing Special Effects.
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family