BitmapDataPath example for Visual Basic

Note: Also works with Access 95 and 97.

This example shows how to load an image from the Internet. It uses the BitmapDataPath property to start the asynchronous load; then uses the ReadyStateChange event to paint the image when loading is complete.

Private Sub Command1_Click()
    ' Start the asynchronous load.
    Lead1.BitmapDataPath = "http://www.leadtools.com/images/vbaward.jpg"
End Sub

Private Sub Lead1_ReadyStateChange(ReadyState As Long)
    ' Paint the image when loading is complete.
    If ReadyState = READYSTATE_COMPLETE Then
        Lead1.AutoSetRects = True
        Lead1.PaintSizeMode = PAINTSIZEMODE_FIT
        Lead1.ForceRepaint
    End If
End Sub