BitmapDataPath Example for C++ 4.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.

void CTutorDlg::OnOK() 
{
   // Start the asynchronous load.
   m_Lead1.SetBitmapDataPath("http://www.leadtools.com/images/vbaward.jpg");
}

void CTutorDlg::OnReadyStateChangeLead1(long ReadyState) 
{
   // Paint the image when loading is complete.
   if (ReadyState == READYSTATE_COMPLETE)
   {
      m_Lead1.SetAutoSetRects(TRUE);
      m_Lead1.SetPaintSizeMode(PAINTSIZEMODE_FIT);
      m_Lead1.ForceRepaint();
   }
}