ColorRes example for C++ 5.0 and later
This example checks to see if the bitmap is 8 bits per pixel and converts it if it is not.
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
if (m_LEADRasterView1.GetRaster().GetBitmapBits() != 8)
{
BeginWaitCursor();
pRasterProc->ColorRes(m_LEADRasterView1.GetRaster(),
8, CRP_OPTIMIZEDPALETTE,
CRD_FLOYDSTEINDITHERING, 0);
m_LEADRasterView1.ForceRepaint();
EndWaitCursor();
}
pRasterProc->Release();