Dst... example for Visual Basic

Note: Also works with Access 95 and 97.

' Declare local variables
Dim ClHeight, ClWidth

' Set variables for the client area of the control.
ClHeight = Lead1.ScaleHeight
ClWidth = Lead1.ScaleWidth

'Calculate the values to zoom in by 10 percent and center the image.
Lead1.DstWidth = Lead1.DstWidth * 1.1
Lead1.DstHeight = Lead1.DstHeight * 1.1
Lead1.DstTop = (ClHeight - Lead1.DstHeight) / 2
Lead1.DstLeft = (ClWidth - Lead1.DstWidth) / 2

'Set the clipping area to the same as the destination rectangle
Lead1.DstClipWidth = Lead1.DstWidth
Lead1.DstClipHeight = Lead1.DstHeight
Lead1.DstClipTop = Lead1.DstTop
Lead1.DstClipLeft = Lead1.DstLeft

'Redisplay the image
Lead1.ForceRepaint