CombineExt example for Visual Basic

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

   Dim TrimLeft As Single, TrimTop As Single, TrimWidth As Single, TrimHeight As Single
   Dim DstLeft As Single, DstTop As Single, DstWidth As Single, DstHeight As Single
   Dim SrcLeft As Single, SrcTop As Single
   LEAD2.Bitmap = LEAD1.Bitmap
   TrimLeft = (LEAD2.BitmapWidth * 0.2)
   TrimTop = (LEAD2.BitmapHeight * 0.2)
   TrimWidth = (LEAD2.BitmapWidth * 0.6)
   TrimHeight = (LEAD2.BitmapHeight * 0.6)
   LEAD2.Trim TrimLeft, TrimTop, TrimWidth, TrimHeight
   LEAD2.SpatialFilter FLT_LINESEG_HORZ
   DstLeft = TrimLeft
   DstTop = TrimTop
   DstWidth = TrimWidth
   DstHeight = TrimHeight
   SrcLeft = 0
   SrcTop = 0
   LEAD1.CombineExt DstLeft, DstTop, DstWidth, DstHeight, LEAD2.Bitmap, SrcLeft, SrcTop, CB_OP_ADD
   LEAD1.ForceRepaint