PaintEffect example for C++ 4.0 and later

The following functions use the KeyDown and KeyUp events to repaint the image with effects.

VOID CSampleDlg::Lead1_OnKeyDown(short FAR * KeyCode, short Shift)
{
   if (*KeyCode == 116) // Code for F5
   {
      m_Lead1.SetAutoRepaint(FALSE);
      m_Lead1.SetBackErase(TRUE);
      m_Lead1.SetEffectGrain(20);
      m_Lead1.SetEffectDelay(50);
      m_Lead1.SetWandSize(5);
      m_Lead1.SetWandColor(RGB(255,255,0));   // Yellow wand
      m_Lead1.SetPaintEffect(EFX_EFFECT_WIPE_L_TO_R);
      m_Lead1.ForceRepaint();
   }
}

VOID CSampleDlg::Lead1_OnKeyUp(short FAR * KeyCode, short Shift)
{
   if (*KeyCode == 116) // Code for F5
   {
      m_Lead1.SetPaintEffect(EFX_EFFECT_WIPE_R_TO_L);
      m_Lead1.ForceRepaint();
      m_Lead1.SetPaintEffect(EFX_EFFECT_NONE);
   }
}