Correlation Example for C++ 5.0 and later
CString strMsg;
ILEADRaster* m_pCorRaster= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pCorRaster);
ILEADRasterIO* m_pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
(void**)&m_pRasterIO);
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess,
(void**)&m_pRasterProc);
m_pRasterIO->Load(m_pCorRaster,
"c:\\T.cmp", 0, 0, 1);
m_pRasterProc->CorrelationMaxPoints
= 90;
m_pRasterProc->Correlation
(m_LeadRasterView.GetRaster(),
m_pCorRaster, 1, 1, 90);
for (int i = 0; i<m_pRasterProc->CorrelationCount;++i)
{
strMsg.Format (TEXT("X = %d\n ,Y = %d\n"),m_pRasterProc->GetCorrelationX(i),m_pRasterProc->GetCorrelationX(i));
MessageBox(strMsg);
}
m_pRasterProc->Release();
m_pCorRaster->Release();
m_pRasterIO->Release();