GradientFillRectangle(Graphics,Rectangle,SpecialEffectsGradientStyle,Color,Color,int) Method

Summary

Draws a rectangle onto the target device context, and then fills the rectangle with a gradient that begins with the specified starting color and ends with the specified ending color.

Syntax

C#
VB
C++
  
Public Overloads Sub GradientFillRectangle( _ 
   ByVal graphics As Graphics, _ 
   ByVal destRect As Rectangle, _ 
   ByVal gradientStyle As SpecialEffectsGradientStyle, _ 
   ByVal startColor As Color, _ 
   ByVal endColor As Color, _ 
   ByVal steps As Integer _ 
)  

public void GradientFillRectangle( 
   Graphics graphics, 
   Rectangle destRect, 
   SpecialEffectsGradientStyle gradientStyle, 
   Color startColor, 
   Color endColor, 
   int steps 
) 

public: 
void GradientFillRectangle(  
   Graphics^ graphics, 
   Rectangle destRect, 
   SpecialEffectsGradientStyle gradientStyle, 
   Color startColor, 
   Color endColor, 
   int steps 
)  

Parameters

graphics
The destination Graphics object, 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.

Remarks

For more information, refer to Implementing Special Effects.

Example

This Example shows the minimum requirements for using the GradientFillRectangle(Graphics,Rectangle,SpecialEffectsGradientStyle,Color,Color,Int32) method to draw and fill a rectangle with a color gradient.

C#
VB
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.SpecialEffects; 
using Leadtools.Drawing; 
 
public void GradientFillRectangle(Graphics g, Rectangle destRect) 
{ 
   SpecialEffectsProcessor processor = new SpecialEffectsProcessor(); 
 
   processor.GradientFillRectangle(g, destRect, SpecialEffectsGradientStyle.EllipseToC, Color.Red, Color.Blue, 12); 
} 

Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.SpecialEffects 
Imports Leadtools.Drawing 
 
Public Sub GradientFillRectangle(ByVal g As Graphics, ByVal destRect As Rectangle) 
   Dim processor As SpecialEffectsProcessor = New SpecialEffectsProcessor() 
 
   processor.GradientFillRectangle(g, destRect, SpecialEffectsGradientStyle.EllipseToC, Color.Red, Color.Blue, 12) 
End Sub 

Requirements

Target Platforms

Help Version 20.0.2018.6.20
Products | Support | Contact Us | Copyright Notices
© 1991-2018 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.SpecialEffects Assembly