PaintEffectMaxPasses example for C++ 4.0 and later

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

void CTutorDlg::OnButton1() 
{
ILEADRasterIO *pRasterIO=NULL;
   CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
                    IID_ILEADRasterIO, (void**)&pRasterIO);      m_LEADRasterView1.SetAutoRepaint(FALSE);
   // Set the effect
   m_LEADRasterView1.SetPaintEffect(EFX_EFFECT_WIPE_L_TO_R); 
   m_LEADRasterView1.SetPaintEffectMaxPasses(5);    // 5 total passes
   m_LEADRasterView1.SetPaintEffectPass(1);         // Start with pass number 1
   m_LEADRasterView1.SetPaintNotificationDelay(200); // Delay 200 milliseconds between passes
   pRasterIO->Load(m_LEADRasterView1.GetRaster(), "c:\\lead\\images\\image1.cmp", 0, 0, 1);   // load the image
   m_LEADRasterView1.SetAutoRepaint(TRUE);
pRasterIO->Release();
}
void CTutorDlg::OnPaintNotificationLeadrasterview1(short uPass, short uType)
{
  // If the first pass is complete
  if ((uType == EFX_NOTIFY_IMAGE) && (uPass > 0)) 
  {
    // Toggle the effect from left_to_right to right_to_left
    if (m_LEADRasterView1.GetPaintEffect()== EFX_EFFECT_WIPE_L_TO_R)
       m_LEADRasterView1.SetPaintEffect(EFX_EFFECT_WIPE_R_TO_L);
    else
       m_LEADRasterView1.SetPaintEffect(EFX_EFFECT_WIPE_L_TO_R);
  }
}