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



g
The destination Graphics object.
destRect
Rectangle to be used as the display destination rectangle.
frameStyle
Frame style.For valid values, refer to SpecialEffectsFrameStyleFlags.
frameWidth
Middle band width.
frameColor
Value that specifies the middle band color.
innerWidth
Inner band width.
innerColor1
Value that specifies the inner band shadow color.
innerColor2
Value that specifies the inner band highlight color.
outerWidth
Outer band width.
outerColor1
Value that specifies the outer band shadow color.
outerColor2
Value that specifies the outer band highlight color.
g
The destination Graphics object.
destRect
Rectangle to be used as the display destination rectangle.
frameStyle
Frame style.For valid values, refer to SpecialEffectsFrameStyleFlags.
frameWidth
Middle band width.
frameColor
Value that specifies the middle band color.
innerWidth
Inner band width.
innerColor1
Value that specifies the inner band shadow color.
innerColor2
Value that specifies the inner band highlight color.
outerWidth
Outer band width.
outerColor1
Value that specifies the outer band shadow color.
outerColor2
Value that specifies the outer band highlight color.
Draws a rectangular frame having the specified style, color, and border width onto the target device context.

Syntax

Visual Basic (Declaration) 
Overloads Public Function DrawFrame( _
   ByVal g As Graphics, _
   ByVal destRect As Rectangle, _
   ByVal frameStyle As SpecialEffectsFrameStyleFlags, _
   ByVal frameWidth As Integer, _
   ByVal frameColor As Color, _
   ByVal innerWidth As Integer, _
   ByVal innerColor1 As Color, _
   ByVal innerColor2 As Color, _
   ByVal outerWidth As Integer, _
   ByVal outerColor1 As Color, _
   ByVal outerColor2 As Color _
) As Rectangle
Visual Basic (Usage)Copy Code
Dim instance As SpecialEffectsProcessor
Dim g As Graphics
Dim destRect As Rectangle
Dim frameStyle As SpecialEffectsFrameStyleFlags
Dim frameWidth As Integer
Dim frameColor As Color
Dim innerWidth As Integer
Dim innerColor1 As Color
Dim innerColor2 As Color
Dim outerWidth As Integer
Dim outerColor1 As Color
Dim outerColor2 As Color
Dim value As Rectangle
 
value = instance.DrawFrame(g, destRect, frameStyle, frameWidth, frameColor, innerWidth, innerColor1, innerColor2, outerWidth, outerColor1, outerColor2)
C++/CLI 
public:
Rectangle DrawFrame( 
   Graphics^ g,
   Rectangle destRect,
   SpecialEffectsFrameStyleFlags frameStyle,
   int frameWidth,
   Color frameColor,
   int innerWidth,
   Color innerColor1,
   Color innerColor2,
   int outerWidth,
   Color outerColor1,
   Color outerColor2
) 

Parameters

g
The destination Graphics object.
destRect
Rectangle to be used as the display destination rectangle.
frameStyle
Frame style.For valid values, refer to SpecialEffectsFrameStyleFlags.
frameWidth
Middle band width.
frameColor
Value that specifies the middle band color.
innerWidth
Inner band width.
innerColor1
Value that specifies the inner band shadow color.
innerColor2
Value that specifies the inner band highlight color.
outerWidth
Outer band width.
outerColor1
Value that specifies the outer band shadow color.
outerColor2
Value that specifies the outer band highlight color.

Return Value

The dimensions of the destination rectangle. The destination rectangle will be updated if the frameStyle is AdjustRectangle.

Example

This example shows the minimum requirements for using the DrawFrame(Graphics,Rectangle,SpecialEffectsFrameStyleFlags,Int32,Color,Int32,Color,Color,Int32,Color,Color) method to draw a frame with a palette.

Visual BasicCopy Code
Public Sub DrawFrame(ByVal g As Graphics, ByVal destRect As Rectangle)
   Dim processor As SpecialEffectsProcessor = New SpecialEffectsProcessor()
   processor.DrawFrame(g, destRect, SpecialEffectsFrameStyleFlags.OuterRaised, 2, Color.Red, 2, Color.FromArgb(100, 100, 100), Color.Black, 2, Color.Gray, Color.Yellow) ' inner band highlight color 
End Sub
C#Copy Code
public void DrawFrame(Graphics g, Rectangle destRect)
{
   SpecialEffectsProcessor processor = new SpecialEffectsProcessor();
   processor.DrawFrame(g,
                       destRect, /* Destination rectangle */
                       SpecialEffectsFrameStyleFlags.OuterRaised, /* outer band raised */
                       2, /* middle band width*/
                       Color.Red, /* middle band color */
                       2, /* inner band width*/
                       Color.FromArgb(100, 100, 100), /* inner band shadow color */
                       Color.Black, /* inner band highlight color */
                       2, /* outer band width*/
                       Color.Gray, /* inner band shadow color */
                       Color.Yellow); /* inner band highlight color */
}

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