LEADTOOLS Special Effects (Leadtools.SpecialEffects assembly)

DrawRotated3dText(IntPtr,String,Rectangle,Int32,SpecialEffectsTextStyle,SpecialEffectsTextAlignmentFlags,Int32,Int32,Color,Color,Color,IntPtr,IntPtr) Method

Show in webframe
Example 





Handle to a destination device context.
Text string.
Rectangle to be used as the display destination rectangle.
Text angle, in tenths of degrees.
Text style. Use this parameter to control the style and justification of the three-dimensional text. For valid values refer to SpecialEffectsTextStyle.
Text Alignment, For valid values refer to SpecialEffectsTextAlignmentFlags.
Horizontal shadow position.
Vertical shadow position.
Value that specifies the text color.
Value that specifies the shadow color.
Value that specifies the border color.
A handle to the System.Drawing.Font object that will be used for drawing the 3D text.
a handle to 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.
Draws three-dimensional text which is rotated by the amount specified onto the target device context using the specified font, color, and style.
Syntax
public void DrawRotated3dText( 
   IntPtr hdc,
   string text,
   Rectangle destRect,
   int angle,
   SpecialEffectsTextStyle textStyle,
   SpecialEffectsTextAlignmentFlags textAlignment,
   int xDepth,
   int yDepth,
   Color textColor,
   Color shadowColor,
   Color hiliteColor,
   IntPtr textHfont,
   IntPtr foreImageHdc
)
'Declaration
 
Public Overloads Sub DrawRotated3dText( _
   ByVal hdc As IntPtr, _
   ByVal text As String, _
   ByVal destRect As Rectangle, _
   ByVal angle As Integer, _
   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 textHfont As IntPtr, _
   ByVal foreImageHdc As IntPtr _
) 
'Usage
 
Dim instance As SpecialEffectsProcessor
Dim hdc As IntPtr
Dim text As String
Dim destRect As Rectangle
Dim angle As Integer
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 textHfont As IntPtr
Dim foreImageHdc As IntPtr
 
instance.DrawRotated3dText(hdc, text, destRect, angle, textStyle, textAlignment, xDepth, yDepth, textColor, shadowColor, hiliteColor, textHfont, foreImageHdc)

            

            
public:
void DrawRotated3dText( 
   IntPtr hdc,
   String^ text,
   Rectangle destRect,
   int angle,
   SpecialEffectsTextStyle textStyle,
   SpecialEffectsTextAlignmentFlags textAlignment,
   int xDepth,
   int yDepth,
   Color textColor,
   Color shadowColor,
   Color hiliteColor,
   IntPtr textHfont,
   IntPtr foreImageHdc
) 

Parameters

hdc
Handle to a destination device context.
text
Text string.
destRect
Rectangle to be used as the display destination rectangle.
angle
Text angle, in tenths of degrees.
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
Value that specifies the text color.
shadowColor
Value that specifies the shadow color.
hiliteColor
Value that specifies the border color.
textHfont
A handle to the System.Drawing.Font object that will be used for drawing the 3D text.
foreImageHdc
a handle to 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.
Remarks

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.

Example
Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.SpecialEffects
Imports Leadtools.Drawing

Public Sub DrawRotated3dText(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.DrawRotated3dText(g, "Rotated 3D Text - LEADTOOLS", destRect, 300, 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 DrawRotated3dText(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.DrawRotated3dText(g,
                        "Rotated 3D Text - LEADTOOLS",
                        destRect,
                        300, /* rotate 30 degrees*/
                        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";
}
Requirements

Target Platforms

See Also

Reference

SpecialEffectsProcessor Class
SpecialEffectsProcessor Members
Overload List

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.