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.

'declare the RasterIO object WithEvents
Public WithEvents RasterIO As LEADRasterIO

'create the RasterIO object
Private Sub Form_Load()
'........
    Set RasterIO = CreateObject("LEADRasterIO.LEADRasterIO. ")
'........
End Sub

Private Sub Command1_Click()
    ' Start the asynchronous load.
    RasterIO.BitmapDataPath LEADRasterView1.Raster, "http://www.leadtools.com/images/tiger2.cmp"
End Sub

Private Sub RasterIO_ReadyStateChange (ByVal ReadyState As Long)
    ' Paint the image when loading is complete.
    If ReadyState = RASTER_READYSTATE_COMPLETE Then
        LEADRasterView1.AutoSetRects = True
        LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT
        LEADRasterView1.ForceRepaint
    End If
End Sub