BitmapDataPath Example for C++ 5.0 and later

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.

NOTE: This is not a complete example for handing events, some steps have been omitted. For a complete example of how to handle events, refer to the example Updating a Gauge and Detecting a User Interrupt.

void CTutorDlg::OnOK() 
{
   // Start the asynchronous load.
   m_pRasterIO->BitmapDataPath(m_LEADRasterView1.GetRaster(),
                               "http://www.leadtools.com/images/tiger2.cmp");
}

void CRasterIOSink::OnReadyStateChange(long ReadyState) 
{
   // Paint the image when loading is complete.
   if(ReadyState == READYSTATE_COMPLETE)
   {
      m_pDlg->m_LEADRasterView1.SetAutoSetRects(TRUE);
      m_pDlg->m_LEADRasterView1.SetPaintSizeMode(PAINTSIZEMODE_FIT);
      m_pDlg->m_LEADRasterView1.ForceRepaint();
   }
}