Src... example for Visual Basic

This example uses the source rectangle properties to zoom in on the image.

'Calculate the values to zoom in by 10 percent and center the image.
If (Lead1.SrcWidth > 1) And (Lead1.SrcHeight > 1) Then
  Lead1.SrcWidth = Lead1.SrcWidth * 0.9
  Lead1.SrcHeight = Lead1.SrcHeight * 0.9
  Lead1.SrcTop = (Lead1.BitmapHeight - Lead1.SrcHeight) / 2
  Lead1.SrcLeft = (Lead1.BitmapWidth - Lead1.SrcWidth) / 2
End If

'Set the clipping area to the same as the source rectangle
Lead1.SrcClipWidth = Lead1.SrcWidth
Lead1.SrcClipHeight = Lead1.SrcHeight
Lead1.SrcClipTop = Lead1.SrcTop
Lead1.SrcClipLeft = Lead1.SrcLeft

'Redisplay the image
Lead1.ForceRepaint