ShowAddFrameDlg Example for C++ 5.0 and later
void CDialogd::OnShowAddFrame()
{
int nRet;
ILEADRaster * SelectedRaster = NULL;
CoCreateInstance(
CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&SelectedRaster
);
ILEADRaster * Raster = NULL;
CoCreateInstance(
CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&Raster
);
m_pRasterImageDlg->ItemsCount = 3;
m_pRasterImageDlg->PutItemFileName (0,"e:\image1.cmp");
m_pRasterImageDlg->PutItemFileName(1,"e:\image2.cmp");
m_pRasterImageDlg->PutItemFileName(2,"e:\image3.cmp");
for (int i= 0; i < m_pRasterColorDlg->ItemsCount; i ++ )
{
m_pRasterIO->Load (Raster,m_pRasterColorDlg->GetItemFileName (i),0,0,1);
m_pRasterImageDlg->PutItemDescription (i,m_pRasterColorDlg->GetItemFileName(i));
m_pRasterImageDlg->PutItemBitmap (i, Raster->GetBitmap ());
}
m_pRasterImageDlg->PutBitmap (m_LeadRasterView.GetRaster().GetBitmap ());
m_pRasterImageDlg->PutUIFlags (ADDFRAME_SHOW_PREVIEW |
ADDFRAME_SHOW_TOOL_ZOOMLEVEL);
nRet = m_pRasterImageDlg->ShowAddFrameDlg((long)this->m_hWnd);
if ( nRet == 0 && m_pRasterImageDlg->DialogStatus == DLG_OK )
{
SelectedRaster->PutBitmap (m_pRasterImageDlg->SelectedBitmap);
nRet = m_pRasterProc->AddFrame (m_LeadRasterView.GetRaster(),
SelectedRaster,
m_pRasterImageDlg->EnableKeepFrameState,
m_pRasterImageDlg->EnableUseMask,
m_pRasterImageDlg->MaskColor,
m_pRasterImageDlg->SmoothEdge,
(AddFrameLocationConstants)m_pRasterImageDlg->Location,
m_pRasterImageDlg->GetQuality()
);
}
SelectedRaster->Release();
Raster->Release();
}