public void Draw3dText(
IntPtr hdc,
string text,
Rectangle destRect,
SpecialEffectsTextStyle textStyle,
SpecialEffectsTextAlignmentFlags textAlignment,
int xDepth,
int yDepth,
Color textColor,
Color shadowColor,
Color hiliteColor,
IntPtr textHfont,
IntPtr foreImageHdc
)
hdc
Handle to a device context.
text
Text string.
destRect
Rectangle to be used as the display destination rectangle.
textStyle
Text style. Use this parameter to control the style and justification of the three-dimensional text. For valid values refer to SpecialEffectsTextStyle.
textAlignment
Text Alignment, For valid values refer to SpecialEffectsTextAlignmentFlags.
xDepth
Horizontal shadow position.
yDepth
Vertical shadow position.
textColor
Text color.
shadowColor
Shadow color.
hiliteColor
Border color.
textHfont
A handle to a System.Drawing.Font object that will be used for drawing the 3D text.
foreImageHdc
a handle to a System.Drawing.Graphics object that will be used to place an image (such as a gradient) on the surface of the three-dimensional text. Use null to paint the color specified in textColor.
Use the textStyle and textAlignment parameters to control the style and justification of the three-dimensional text. Use the textFont parameter to place an image (such as a gradient) on the surface of the three-dimensional text.
Drop shadows are available only for the following textStyle values:
shadowColor is available only for the following textStyle values:
hiliteColor is available only for the following textStyle values:
For general information, refer to Implementing Special Effects.
This example shows the minimum requirements for using the Draw3dText(Graphics,String,Rectangle,SpecialEffectsTextStyle,SpecialEffectsTextAlignmentFlags,Int32,Int32,Color,Color,Color,Font,Image) method.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.SpecialEffects;
using Leadtools.Drawing;
public void Draw3dText(Graphics g, Rectangle destRect)
{
SpecialEffectsProcessor processor = new SpecialEffectsProcessor();
Font textFont = new Font("Arial", 24);
Image image = Image.FromFile(Path.Combine(LEAD_VARS.ImagesDir, "Ulay1.bmp"));
processor.Draw3dText(g,
"3D Text - LEADTOOLS",
destRect,
SpecialEffectsTextStyle.DropShadow,
SpecialEffectsTextAlignmentFlags.HorizontalCenter | SpecialEffectsTextAlignmentFlags.VerticalCenter,
2, /* horizontal shadow position */
2, /* vertical shadow position */
Color.Blue, /* text color, blue */
Color.Black,/* shadow color, black */
Color.White, /* border color, white */
textFont,
image);
image.Dispose();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";
}