DrawFrame(Graphics,Rectangle,SpecialEffectsFrameStyleFlags,int,Color,int,Color,Color,int,Color,Color) Method

Summary

Draws a rectangular frame having the specified style, color, and border width onto the target device context.

Syntax
C#
VB
C++
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 
) 
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 
public:  
   Rectangle^ DrawFrame( 
       Graphics^ g, 
      Rectangle^ destRect, 
      SpecialEffectsFrameStyleFlags^ frameStyle, 
      Int32 frameWidth, 
      Color^ frameColor, 
      Int32 innerWidth, 
      Color^ innerColor1, 
      Color^ innerColor2, 
      Int32 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.

Remarks

For general information, refer to Implementing Special Effects.

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.

C#
VB
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.SpecialEffects; 
using Leadtools.Drawing; 
 
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 */ 
} 
Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.SpecialEffects 
Imports Leadtools.Drawing 
 
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 

Requirements

Target Platforms

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.SpecialEffects Assembly