LineProfile example for Visual C++ 5.0 and later
long maxR = 0, maxG = 0, maxB = 0;
int i;
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->LineProfile (m_RasterView.GetRaster (), 10, 10, 220, 120);
for(i=0; i<pRasterProc->GetLineProfileSize (); ++i)
{
if(pRasterProc->GetLineProfileRed(i) > maxR) maxR = pRasterProc->GetLineProfileRed(i);
if(pRasterProc->GetLineProfileGreen (i) > maxG) maxG = pRasterProc->GetLineProfileGreen(i);
if(pRasterProc->GetLineProfileBlue (i) > maxB) maxB = pRasterProc->GetLineProfileBlue(i);
}
pRasterProc->Release();
CString msg;
msg.Format(TEXT("maxR=%ld, maxG=%ld, maxB=%ld"), maxR, maxG, maxB);
AfxMessageBox(msg);