BinaryFilter example for C++ 5.0 and later

This example does omni-directional erosion of black objects and repaints the image.

 //You must unlock support for this feature
   //L_KEY_DOCUMENT represents the unlock support string
   
   m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
   ILEADRasterProcess *pRasterProc=NULL;
   CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

   pRasterProc->PutEnableMethodErrors(FALSE);
   int nRet = pRasterProc->BinaryFilter(m_LEADRasterView1.GetRaster(),BFLT_EROSION_OMNI);
   if (nRet != 0)
   {
      CString strErr;
      strErr.Format(TEXT("BinaryFilter Error: %d\n"), nRet);
      AfxMessageBox(strErr);
   }
   m_LEADRasterView1.ForceRepaint();
   pRasterProc->Release();