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.

Dim LeadRasIO As New LEADRasterIO
Dim RasterFxd As New LEADRasterFXD
Dim LeadRasProc As New LEADRasterProcess
LEADRasterView1.AutoRepaint = False
LEADRasterView1.ScaleMode = 3
'Load an image for the main control
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_NORMAL
LeadRasIO.Load LEADRasterView1.Raster, "c:\temp\golf.jpg", 0, 0, 1
'Load an image for the foreground of the text
LeadRasIO.Load LEADRasterView2.Raster, "d:\lead14\dist\images\ulay1.bmp", 0, 0, 1
'Text location
RasterFxd.TextTop = 50
RasterFxd.TextLeft = 50
RasterFxd.TextWidth = LEADRasterView1.DstWidth - 50
RasterFxd.TextHeight = LEADRasterView1.DstHeight - 50
'The foreground image needs to be the correct size.
LeadRasProc.Size LEADRasterView2.Raster, RasterFxd.TextWidth, RasterFxd.TextHeight, 0
'Text alignment and angle
RasterFxd.TextAlign = FXD_TEXTALIGN_HCENTER_VCENTER
RasterFxd.TextAngle = 450   '45 degrees
'Text highlight color and style
RasterFxd.TextHiliteColor = RGB(255, 255, 255)
RasterFxd.TextStyle = FXD_TEXTSTYLE_DROPSHADOW
'Text drop shadow
RasterFxd.ShadowColor = RGB(0, 0, 0)
RasterFxd.ShadowXDepth = 5
RasterFxd.ShadowYDepth = 5
'Make the text a permanent part of the bitmap
RasterFxd.DrawPersistence = True
RasterFxd.DstLeft = 0
RasterFxd.DstTop = 0
RasterFxd.DstRight = LEADRasterView1.Raster.BitmapWidth
RasterFxd.DstBottom = LEADRasterView1.Raster.BitmapHeight
RasterFxd.SrcLeft = 0
RasterFxd.SrcTop = 0
RasterFxd.SrcRight = LEADRasterView1.Raster.BitmapWidth
RasterFxd.SrcBottom = LEADRasterView1.Raster.BitmapHeight
RasterFxd.ScaleMode = 3
'Draw the text
RasterFxd.DrawText LEADRasterView1.Raster, 0, "LEADTOOLS", LEADRasterView1.Raster.Bitmap
LEADRasterView1.ForceRepaint