SetSrcRect example for Visual Basic

Note: Also works with Access 95 and 97.

This example zooms in on the image by reducing the source rectangle and repaints the image.

' Declare local variables
Dim NewLeft, NewTop, NewWidth, NewHeight

NewLeft = Lead1.SrcLeft+ (Lead1.SrcWidth * 0.1)
NewTop = Lead1.SrcTop + (Lead1.SrcHeight * 0.1)
NewWidth = Lead1.SrcWidth * 0.8
NewHeight = Lead1.SrcHeight * 0.8
If (NewWidth > 1) AND (NewHeight >1) Then
   Lead1.SetSrcRect NewLeft, NewTop, NewWidth, NewHeight
End If
Lead1.ForceRepaint