DrawShape example for Visual Basic

Note: Also works with Access 95 and 97.

This example demonstrates most of the three-dimensional shape properties as it draws a rectangle on the current bitmap. For example purposes, both inner and outer bands are turned on. However, normal three-dimensional effects use inner bands or outer bands, but not both.

Dim LeadRasIO As New LEADRasterIO
Dim RasterFxd As New LEADRasterFXD

LEADRasterView1.AutoRepaint = False
'Load an image for the main control
LeadRasIO.Load LEADRasterView1.Raster, "v:\images\babe.cmp", 0, 0, 1
'Load an image for the background of the shape
LeadRasIO.Load LEADRasterView2.Raster, "d:\lead14\dist\images\ulay1.bmp", 0, 0, 1
'Shape background
RasterFxd.ShapeBackgroundStyle = FXD_BACKSTYLE_TILED_IMAGE
RasterFxd.BackgroundImageTop = 0
RasterFxd.BackgroundImageLeft = 0
RasterFxd.BackgroundImageWidth = LEADRasterView2.Raster.BitmapWidth
RasterFxd.BackgroundImageHeight = LEADRasterView2.Raster.BitmapHeight
'Shape location
RasterFxd.ShapeTop = 50
RasterFxd.ShapeLeft = 50
RasterFxd.ShapeWidth = LEADRasterView1.DstWidth - 50
RasterFxd.ShapeHeight = LEADRasterView1.DstHeight - 50
'Shape border
RasterFxd.ShapeBorderColor = RGB(255, 0, 0)
RasterFxd.ShapeBorderStyle = FXD_BORDERSTYLE_SOLID
RasterFxd.ShapeBorderThickness = 10
RasterFxd.ShapeInnerBandHiliteColor = RGB(255, 255, 255)
RasterFxd.ShapeInnerBandShadowColor = 0
RasterFxd.ShapeInnerBandStyle = FXD_INNERSTYLE_RAISED
RasterFxd.ShapeInnerBandThickness = 2
RasterFxd.ShapeOuterBandHiliteColor = RGB(0, 255, 0)
RasterFxd.ShapeOuterBandShadowColor = RGB(128, 128, 128)
RasterFxd.ShapeOuterBandStyle = FXD_OUTERSTYLE_RAISED
RasterFxd.ShapeOuterBandThickness = 2
'Make the shape 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
RasterFxd.ClientSizeX = 5
RasterFxd.ClientSizeY = 5
'Draw the shape
RasterFxd.DrawShape LEADRasterView1.Raster, 0, FXD_SHAPE_RECTANGLE, LEADRasterView2.Raster
'Repaint
LEADRasterView1.AutoRepaint = True