ShowAddBorderDlg Example for C++ 5.0 and later
void CDialogs::OnShowAddBorderDlg()
{
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,"C:\\1.cmp");
m_pRasterImageDlg->PutItemFileName(1,"C:\\1.bmp");
m_pRasterImageDlg->PutItemFileName(2,"C:\\1.jpg");
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(ADDBORDER_SHOW_PREVIEW |
ADDBORDER_SHOW_TOOL_ZOOMLEVEL);
nRet = m_pRasterImageDlg->ShowAddBorderDlg((long)this->m_hWnd);
SelectedRaster->PutBitmap (m_pRasterImageDlg->SelectedBitmap);
if ( nRet == 0 && m_pRasterImageDlg->DialogStatus == DLG_OK )
{
nRet = m_pRasterProc->AddBorder (m_LeadRasterView.GetRaster(),
m_pRasterImageDlg->LeftThickness,
m_pRasterImageDlg->TopThickness,
m_pRasterImageDlg->RightThickness,
m_pRasterImageDlg->BottomThickness,
(AddBorderLocationConstants)m_pRasterImageDlg->Location,
m_pRasterImageDlg->GetBorderStyle(),
m_pRasterImageDlg->GetEffectStyle(),
SelectedRaster,
m_pRasterImageDlg->GetGradientStyle(),
m_pRasterImageDlg->GradientStartColor,
m_pRasterImageDlg->GradientEndColor,
m_pRasterImageDlg->CurveIntensity,
m_pRasterImageDlg->GetEnableSoftCurve(),
m_pRasterImageDlg->GetEnableShadow(),
m_pRasterImageDlg->ShadowSize,
m_pRasterImageDlg->GetShadowDirection(),
m_pRasterImageDlg->GetEnableBumpyShadow()
);
m_LeadRasterView.GetRaster ().SetBitmap (SelectedRaster->Bitmap);
}
SelectedRaster->Release();
Raster->Release();
}