LEADTOOLS Special Effects (Leadtools.SpecialEffects assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.30
GradientPatternFillRectangle(IntPtr,Rectangle,SpecialEffectsPatternStyle,Color,Color) Method
See Also 
Leadtools.SpecialEffects Namespace > SpecialEffectsProcessor Class > GradientPatternFillRectangle Method : GradientPatternFillRectangle(IntPtr,Rectangle,SpecialEffectsPatternStyle,Color,Color) Method



hdc
Handle to a device context.
destRect
Rectangle to be used as the display destination rectangle.
patternStyle
Filling style. For possible values refer to SpecialEffectsPatternStyle.
backColor
Value that specifies the background color.
foreColor
Value that specifies the foreground color.
hdc
Handle to a device context.
destRect
Rectangle to be used as the display destination rectangle.
patternStyle
Filling style. For possible values refer to SpecialEffectsPatternStyle.
backColor
Value that specifies the background color.
foreColor
Value that specifies the foreground color.
Draws a rectangle onto the target device context, and then fills the rectangle with the specified pattern and color.

Syntax

Visual Basic (Declaration) 
Overloads Public Sub GradientPatternFillRectangle( _
   ByVal hdc As IntPtr, _
   ByVal destRect As Rectangle, _
   ByVal patternStyle As SpecialEffectsPatternStyle, _
   ByVal backColor As Color, _
   ByVal foreColor As Color _
) 
Visual Basic (Usage)Copy Code
Dim instance As SpecialEffectsProcessor
Dim hdc As IntPtr
Dim destRect As Rectangle
Dim patternStyle As SpecialEffectsPatternStyle
Dim backColor As Color
Dim foreColor As Color
 
instance.GradientPatternFillRectangle(hdc, destRect, patternStyle, backColor, foreColor)
C# 
public void GradientPatternFillRectangle( 
   IntPtr hdc,
   Rectangle destRect,
   SpecialEffectsPatternStyle patternStyle,
   Color backColor,
   Color foreColor
)
C++/CLI 
public:
void GradientPatternFillRectangle( 
   IntPtr hdc,
   Rectangle destRect,
   SpecialEffectsPatternStyle patternStyle,
   Color backColor,
   Color foreColor
) 

Parameters

hdc
Handle to a device context.
destRect
Rectangle to be used as the display destination rectangle.
patternStyle
Filling style. For possible values refer to SpecialEffectsPatternStyle.
backColor
Value that specifies the background color.
foreColor
Value that specifies the foreground color.

Example

This example shows the minimum requirements for using the GradientPatternFillRectangle(Graphics,Rectangle,SpecialEffectsPatternStyle,Color,Color) method to draw and fill a rectangle with a pattern and color.

Visual BasicCopy Code
Public Sub GradientPatternFillRectangle(ByVal g As Graphics, ByVal destRect As Rectangle)
   Dim processor As SpecialEffectsProcessor = New SpecialEffectsProcessor()
   processor.GradientPatternFillRectangle(g, destRect, SpecialEffectsPatternStyle.DiagonalCross, Color.Black, Color.Blue)
End Sub
C#Copy Code
public void GradientPatternFillRectangle(Graphics g, Rectangle destRect)
{
   SpecialEffectsProcessor processor = new SpecialEffectsProcessor();
   processor.GradientPatternFillRectangle(g,
                                          destRect,
                                          SpecialEffectsPatternStyle.DiagonalCross,
                                          Color.Black,
                                          Color.Blue);
}

Remarks

For general information, refer to Implementing Special Effects.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also