Combine example for Visual Basic

This example copies the LEADRasterView1 bitmap to LEADRasterView2, trims and filters the copied image, and combines the filtered image with the original LEADRasterView1 bitmap image. Trimming LEADRasterView2 lets you see the difference between filtered and nonfiltered regions.

Dim DstLeft As Single
Dim DstTop As Single
Dim DstWidth As Single
Dim DstHeight As Single
Dim RasterProc as New LEADRasterProcess
MousePointer = 11 ' hourglass
LEADRasterView2.Raster.RefBitmap = False
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Raster.Bitmap
TrimLeft = (LEADRasterView2.Raster.BitmapWidth * 0.2)
TrimTop = (LEADRasterView2.Raster.BitmapHeight * 0.2)
TrimWidth = (LEADRasterView2.Raster.BitmapWidth * 0.6)
TrimHeight = (LEADRasterView2.Raster.BitmapHeight * 0.6)
RasterProc.Trim LEADRasterView2.Raster, TrimLeft, TrimTop, TrimWidth, TrimHeight
RasterProc.SpatialFilter LEADRasterView2.Raster, FLT_LINESEG_LTOR
DstLeft = TrimLeft
DstTop = TrimTop
DstWidth = TrimWidth
DstHeight = TrimHeight
SrcLeft = 0
SrcTop = 0
RasterProc.Combine LEADRasterView1.Raster, DstLeft, DstTop, _
                   DstWidth, DstHeight, _
                   LEADRasterView2.Raster, _
                   SrcLeft, SrcTop, CB_OP_ADD
LEADRasterView1.ForceRepaint
MousePointer = 0 ' default