GetFeretsDiameter example for C++ 5.0 and later
int Top, Bottom, Left, Right ;
CString strMsg;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
Top = m_LeadRasterView.GetRaster().GetBitmapHeight() / 4;
Bottom = m_LeadRasterView.GetRaster().GetBitmapHeight () * 6 / 4;
Left = m_LeadRasterView.GetRaster().GetBitmapWidth() / 4;
Right = m_LeadRasterView.GetRaster().GetBitmapWidth() * 3 / 4;
m_LeadRasterView.GetRaster().SetRgnEllipse(Left, Top, Right, Bottom, L_RGN_SET);
m_pRasterProc->GetRgnContourPoints(m_LeadRasterView.GetRaster());
for (int i = 0; i< m_pRasterProc->ContoursCount; ++i)
{
strMsg.Format(TEXT("(%d , %d)"),m_pRasterProc->GetContourX(i),m_pRasterProc->GetContourY(i));
MessageBox(strMsg);
}
m_pRasterProc->GetFeretsDiameter();
strMsg.Format(TEXT("Ferets Diameter Length :%d \n \
Ferets First Index :%d \n \
Ferets Second Index:%d \n"),
m_pRasterProc->FeretsDiameterLength,
m_pRasterProc->FeretsFirstIndex,
m_pRasterProc->FeretsSecondIndex);
MessageBox(strMsg);
m_pRasterProc->Release();