ShowShapeDlg Example for C++ 5.0 and later
void CDialogs::OnShowShapeDlg()
{
int nRet;
m_pRasterEfxDlg->Shape->BackgroundBitmap = m_LeadRasterView2.GetRaster().GetBitmap ();
m_pRasterEfxDlg->Shape->ShapeStyle = FXD_SHAPE_PARALLELOGRAM_R;
m_pRasterEfxDlg->Shape->BackColor= RGB ( 0, 0, 255 );
m_pRasterEfxDlg->Shape->BackgroundStyle= FXD_BACKSTYLE_OPAQUE;
m_pRasterEfxDlg->Shape->FillStyle= FXD_PATTERN_SOLID;
m_pRasterEfxDlg->Shape->BorderColor= RGB ( 100, 255, 100 );
m_pRasterEfxDlg->Shape->BorderStyle= FXD_BORDERSTYLE_SOLID;
m_pRasterEfxDlg->Shape->BorderThickness= 5;
m_pRasterEfxDlg->Shape->InnerHiliteColor= RGB ( 255, 255, 255 );
m_pRasterEfxDlg->Shape->InnerShadowColor= RGB ( 0, 0, 0 );
m_pRasterEfxDlg->Shape->InnerStyle= FXD_SHAPE_INNERSTYLE_INSET;
m_pRasterEfxDlg->Shape->InnerThickness= 3;
m_pRasterEfxDlg->Shape->OuterHiliteColor= RGB ( 255, 255, 0 );
m_pRasterEfxDlg->Shape->OuterShadowColor= RGB ( 255, 0, 255 );
m_pRasterEfxDlg->Shape->OuterStyle= FXD_SHAPE_OUTERSTYLE_INSET;
m_pRasterEfxDlg->Shape->OuterThickness= 5;
m_pRasterEfxDlg->Shape->ShadowXDepth= 10;
m_pRasterEfxDlg->Shape->ShadowYDepth= 10;
m_pRasterEfxDlg->Shape->ShadowColor= RGB ( 128, 128, 128 ); 1
m_pRasterEfxDlg->Shape->ForeColor= RGB ( 255, 0, 0 );
m_pRasterEfxDlg->UIFlags= SHAPE_SHOW_PREVIEW |
SHAPE_AUTOPREVIEW |
SHAPE_BACKSTYLE |
SHAPE_FILLSTYLE |
SHAPE_FORE_BACK_COLOR |
SHAPE_BORDERSTYLE |
SHAPE_BORDERWIDTH |
SHAPE_BORDERCOLOR |
SHAPE_INNERSTYLE |
SHAPE_INNERWIDTH |
SHAPE_INNER_HILITE_SHADOW |
SHAPE_OUTERSTYLE |
SHAPE_OUTERWIDTH |
SHAPE_OUTER_HILITE_SHADOW |
SHAPE_SHADOWCOLOR |
SHAPE_SHADOW_X_Y |
SHAPE_BROWSEIMAGE |
SHAPE_CLASS_SQUARE |
SHAPE_CLASS_RECTANGLE |
SHAPE_CLASS_PARALLELOGRAM |
SHAPE_CLASS_TRAPEZOID |
SHAPE_CLASS_TRIANGLE |
SHAPE_CLASS_OTHER |
SHAPE_CLASS_CIRCLE |
SHAPE_CLASS_ELLIPSE |
SHAPE_CLASS_STAR |
SHAPE_CLASS_CROSS |
SHAPE_CLASS_ARROW;
m_pRasterEfxDlg->EnableMethodErrors= false;
m_pRasterEfxDlg->Bitmap= m_LeadRasterView.GetRaster().GetBitmap ();
m_pRasterEfxDlg->ShowHelpButton= true;
nRet =m_pRasterEfxDlg->ShowShapeDlg ((long)this->m_hWnd);
if ( nRet == 0 && m_pRasterEfxDlg->DialogStatus ==DLG_OK )
{
m_pRasterFxd->ShapeLeft = 50;
m_pRasterFxd->ShapeTop = 50;
m_pRasterFxd->ShapeWidth = m_LeadRasterView.GetDstWidth () - 50;
m_pRasterFxd->ShapeHeight = m_LeadRasterView.GetDstHeight () - 50;
m_pRasterFxd->PatternBackColor = m_pRasterEfxDlg->Shape->BackColor;
m_pRasterFxd->BackgroundImageLeft = 0;
m_pRasterFxd->BackgroundImageTop = 0;
m_pRasterFxd->BackgroundImageWidth = m_LeadRasterView.GetRaster().GetBitmapWidth();
m_pRasterFxd->BackgroundImageHeight = m_LeadRasterView.GetRaster().GetBitmapHeight();
m_pRasterFxd->ShapeBackgroundStyle = m_pRasterEfxDlg->Shape->BackgroundStyle;
m_pRasterFxd->PatternForeColor = m_pRasterEfxDlg->Shape->ForeColor;
m_pRasterFxd->PatternStyle = m_pRasterEfxDlg->Shape->FillStyle;
m_pRasterFxd->ShapeBorderColor = m_pRasterEfxDlg->Shape->BorderColor;
m_pRasterFxd->ShapeBorderStyle = m_pRasterEfxDlg->Shape->BorderStyle;
m_pRasterFxd->ShapeBorderThickness = m_pRasterEfxDlg->Shape->BorderThickness;
m_pRasterFxd->ShapeInnerBandHiliteColor = m_pRasterEfxDlg->Shape->InnerHiliteColor;
m_pRasterFxd->ShapeInnerBandShadowColor = m_pRasterEfxDlg->Shape->InnerShadowColor;
m_pRasterFxd->ShapeInnerBandStyle = m_pRasterEfxDlg->Shape->InnerStyle;
m_pRasterFxd->ShapeInnerBandThickness = m_pRasterEfxDlg->Shape->InnerThickness;
m_pRasterFxd->ShapeOuterBandHiliteColor = m_pRasterEfxDlg->Shape->OuterHiliteColor;
m_pRasterFxd->ShapeOuterBandShadowColor = m_pRasterEfxDlg->Shape->OuterShadowColor;
m_pRasterFxd->ShapeOuterBandStyle = m_pRasterEfxDlg->Shape->OuterStyle;
m_pRasterFxd->ShapeOuterBandThickness = m_pRasterEfxDlg->Shape->OuterThickness;
m_pRasterFxd->ShadowXDepth = m_pRasterEfxDlg->Shape->ShadowXDepth;
m_pRasterFxd->ShadowYDepth = m_pRasterEfxDlg->Shape->ShadowYDepth;
m_pRasterFxd->ShadowColor = m_pRasterEfxDlg->Shape->ShadowColor;
m_pRasterFxd->DrawShape ((ILEADRaster*)m_LeadRasterView.GetRaster().m_lpDispatch , m_LeadRasterView.GetClientDC (), m_pRasterEfxDlg->Shape->ShapeStyle 0);
}
}
void CRasterEfxDlgSink::OnDlgHelp (long DlgFrom, long CtlID)
{
switch(DlgFrom)
{
case HELP_EFFECT:
AfxMessageBox(TEXT("Help from Effect dialog "));
break;
case HELP_SHAPE:
AfxMessageBox(TEXT("Help from Shape dialog "));
case HELP_GETTEXT:
AfxMessageBox(TEXT("Help from GetText dialog "));
break;
case HELP_GETGRADIENT:
AfxMessageBox(TEXT("Help from GetGradient dialog "));
case HELP_GETTRANSITION:
AfxMessageBox(TEXT("Help from GetTransition dialog "));
break;
}
}