ShowRemapIntensityDlg Example for C++ 5.0 and later

void CDialogs::OnShowRemapIntensityDlg()
{
	HRESULT hr;
	int nRet;

	ILEADRasterDlgKrn_U *m_pRasterDlgKrn = NULL;
	hr = CoCreateInstance(CLSID_LEADRasterDlgKrn_U,
		NULL,
		CLSCTX_ALL,
		IID_ILEADRasterDlgKrn_U,
		(LPVOID*)&m_pRasterDlgKrn);

	ILEADRasterDlgClr_U *m_pRasterDlgClr = NULL;
	hr = CoCreateInstance(CLSID_LEADRasterDlgClr_U,
		NULL,
		CLSCTX_ALL,
		IID_ILEADRasterDlgClr_U,
		(LPVOID*)&m_pRasterDlgClr);

	nRet = m_pRasterDlgKrn->InitDlg(INIT_WITH_COLOR);

	m_pRasterDlgClr->PutChannel((ChannelConstants)CHANNEL_RED);
	m_pRasterDlgClr->UIFlags = REMAPINTENSITY_SHOW_PREVIEW |
		REMAPINTENSITY_SHOW_TOOL_ZOOMLEVEL;

	m_pRasterDlgClr->Bitmap =  m_pLead1.GetBitmap();
	nRet = m_pRasterDlgClr->ShowRemapIntensityDlg((long)m_hWnd);

	if ( nRet == 0 && m_pRasterDlgClr->DialogStatus == DLG_OK )
	{
		m_pLead1.SetRemapTableSize(m_pRasterDlgClr->RemapTableSize);

		for (int i= 0; i < m_pRasterDlgClr->RemapTableSize; i++)
		{
			m_pLead1.put_RemapTable(i, m_pRasterDlgClr->GetRemapTable(i));
		}

		m_pLead1.RemapIntensity(m_pRasterDlgClr->GetChannel());
	}
}