Combine example for Access 95 and 97

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.

' Declare local variables
Dim TrimLeft, TrimTop, TrimWidth, TrimHeight 
Dim DstLeft, DstTop, DstWidth, DstHeight, SrcObj, SrcLeft, SrcTop

DoCmd.Hourglass True
Lead2.ScaleMode = 3
Lead1.ScaleMode = 3
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_LTOR)

DstLeft = TrimLeft
DstTop = TrimTop
DstWidth = TrimWidth
DstHeight = TrimHeight
SrcObj = Lead2.Bitmap
SrcLeft = 0
SrcTop = 0
Lead1.Combine DstLeft, DstTop, DstWidth, DstHeight, SrcObj, SrcLeft, SrcTop, CB_OP_ADD

Lead1.ForceRepaint
DoCmd.Hourglass False