PatternStyle (ILEADRasterFXD) example for Visual Basic

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
'Shape background
RasterFxd.ShapeBackgroundStyle = FXD_BACKSTYLE_OPAQUE
RasterFxd.PatternStyle = FXD_PATTERN_CROSS
RasterFxd.PatternBackColor = RGB(255, 0, 0) 'red
RasterFxd.PatternForeColor = RGB(0, 0, 255) 'blue
'Shape location
RasterFxd.ShapeTop = 50
RasterFxd.ShapeLeft = 50
RasterFxd.ShapeWidth = LEADRasterView1.DstWidth - 50
RasterFxd.ShapeHeight = LEADRasterView1.DstHeight - 50
'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, 0
'Repaint
LEADRasterView1.AutoRepaint = True