DrawText example for Visual Basic

Note: Also works with Access 95 and 97.

This example demonstrates most of the properties of a three-dimensional text object as it draws rotated text on the current bitmap.

Lead1.AutoRepaint = False

'Load an image for the main control
Lead1.Load "c:\lead\images\image1.cmp", 0, 0, 1

'Load an image for the foreground of the text
Lead2.Load "ulay1.bmp", 0, 0, 1

'Text location
Lead1.TextTop = 50
Lead1.TextLeft = 50
Lead1.TextWidth = Lead1.DstWidth - 50
Lead1.TextHeight = Lead1.DstHeight - 50

'The foreground image needs to be the correct size.
Lead2.Size Lead1.TextWidth, Lead1.TextHeight, 0

'Text alignment and angle
Lead1.TextAlign = EFX_TEXTALIGN_HCENTER_VCENTER
Lead1.TextAngle = 450   '45 degrees

'Text highlight color and style
Lead1.TextHiliteColor = RGB(255, 255, 255)
Lead1.TextStyle = EFX_TEXTSTYLE_DROPSHADOW

'Text drop shadow
Lead1.ShadowColor = RGB(0, 0, 0)
Lead1.ShadowXDepth = 5
Lead1.ShadowYDepth = 5

'Make the text a permanent part of the bitmap
Lead1.DrawPersistence = True

'Draw the text
Lead1.DrawText "LEADTOOLS", Lead2.Bitmap
Lead1.ForceRepaint