Leadtools.SpecialEffects Namespace > SpecialEffectsProcessor Class > Draw3dText Method : Draw3dText(Graphics,String,Rectangle,SpecialEffectsTextStyle,SpecialEffectsTextAlignmentFlags,Int32,Int32,Color,Color,Color,Font,Image) Method |
public void Draw3dText( Graphics g, string text, Rectangle destRect, SpecialEffectsTextStyle textStyle, SpecialEffectsTextAlignmentFlags textAlignment, int xDepth, int yDepth, Color textColor, Color shadowColor, Color hiliteColor, Font textFont, Image foreImage )
'Declaration Public Overloads Sub Draw3dText( _ ByVal g As Graphics, _ ByVal text As String, _ ByVal destRect As Rectangle, _ ByVal textStyle As SpecialEffectsTextStyle, _ ByVal textAlignment As SpecialEffectsTextAlignmentFlags, _ ByVal xDepth As Integer, _ ByVal yDepth As Integer, _ ByVal textColor As Color, _ ByVal shadowColor As Color, _ ByVal hiliteColor As Color, _ ByVal textFont As Font, _ ByVal foreImage As Image _ )
'Usage Dim instance As SpecialEffectsProcessor Dim g As Graphics Dim text As String Dim destRect As Rectangle Dim textStyle As SpecialEffectsTextStyle Dim textAlignment As SpecialEffectsTextAlignmentFlags Dim xDepth As Integer Dim yDepth As Integer Dim textColor As Color Dim shadowColor As Color Dim hiliteColor As Color Dim textFont As Font Dim foreImage As Image instance.Draw3dText(g, text, destRect, textStyle, textAlignment, xDepth, yDepth, textColor, shadowColor, hiliteColor, textFont, foreImage)
public: void Draw3dText( Graphics^ g, String^ text, Rectangle destRect, SpecialEffectsTextStyle textStyle, SpecialEffectsTextAlignmentFlags textAlignment, int xDepth, int yDepth, Color textColor, Color shadowColor, Color hiliteColor, Font^ textFont, Image^ foreImage )
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:
Shadow colors are available only for the following textStyle values:
Highlight colors are available only for the following textStyle values:
For general information, refer to Implementing Special Effects.
Imports Leadtools Imports Leadtools.Codecs Imports Leadtools.SpecialEffects Imports Leadtools.Drawing Public Sub Draw3dText(ByVal g As Graphics, ByVal destRect As Rectangle) Dim processor As SpecialEffectsProcessor = New SpecialEffectsProcessor() Dim textFont As Font = New Font("Arial", 24) Dim img As Image = Image.FromFile(Path.Combine(LEAD_VARS.ImagesDir, "Ulay1.bmp")) processor.Draw3dText(g, "3D Text - LEADTOOLS", destRect, SpecialEffectsTextStyle.DropShadow, SpecialEffectsTextAlignmentFlags.HorizontalCenter Or _ SpecialEffectsTextAlignmentFlags.VerticalCenter, 2, 2, Color.Blue, Color.Black, Color.White, textFont, img) img.Dispose() End Sub Public NotInheritable Class LEAD_VARS Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" End Class
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:\Users\Public\Documents\LEADTOOLS Images"; }