home *** CD-ROM | disk | FTP | other *** search
- // FxDlg.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "FxDemo.h"
- #include "FxDlg.h"
-
- char *szFileName[] =
- {
- "..\\images\\sample1.cmp",
- "..\\images\\sample2.cmp",
- "..\\images\\sample3.cmp",
- "..\\images\\sample4.cmp",
- "..\\images\\sample5.cmp",
- };
-
- /////////////////////////////////////////////////////////////////////////////
- // CFxDemoDlg dialog
-
- CFxDemoDlg::CFxDemoDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CFxDemoDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CFxDemoDlg)
- //}}AFX_DATA_INIT
- // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
- m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
- }
-
- void CFxDemoDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CFxDemoDlg)
- DDX_Control(pDX, IDC_SHOW_TRANSITION, m_ShowTransition);
- DDX_Control(pDX, IDC_SHOW_TEXT, m_ShowText);
- DDX_Control(pDX, IDC_SHOW_SHAPE, m_ShowShape);
- DDX_Control(pDX, IDC_LEAD, m_Lead);
- DDX_Control(pDX, IDC_LEADDLG, m_LeadDlg);
- DDX_Control(pDX, IDC_LEADSHAPE, m_LeadShape);
- DDX_Control(pDX, IDC_LEADTEXT, m_LeadText);
- //}}AFX_DATA_MAP
- }
-
- BEGIN_MESSAGE_MAP(CFxDemoDlg, CDialog)
- //{{AFX_MSG_MAP(CFxDemoDlg)
- ON_BN_CLICKED(IDC_SHAPE, OnShape)
- ON_BN_CLICKED(IDC_TEXT, OnText)
- ON_BN_CLICKED(IDC_TRANSITION, OnTransition)
- ON_BN_CLICKED(IDC_EFFECT, OnEffect)
- ON_BN_CLICKED(IDC_SHOW, OnShow)
- ON_WM_PAINT()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CFxDemoDlg message handlers
-
- BOOL CFxDemoDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // Set the icon for this dialog. The framework does this automatically
- // when the application's main window is not a dialog
- SetIcon(m_hIcon, TRUE); // Set big icon
- SetIcon(m_hIcon, FALSE); // Set small icon
-
- m_nEffectStyle = EFX_EFFECT_ELLIPSE_C_OUT;
- m_nEffectGrain = 10;
- m_nEffectDelay = 0;
- m_nEffectMaxPass = 1;
- m_nEffectTransparent = 0;
- m_nEffectTransparentColor = RGB(0, 0, 0);
- m_nEffectWandWidth = 0;
- m_nEffectWandColor = RGB(255, 0, 0);
-
- m_nTransitionStyle = EFX_GRADIENT_CONE_FROM_B;
- m_nTransitionBackColor = RGB(255, 0, 0);
- m_nTransitionForeColor = RGB(0, 0, 255);
- m_nTransitionSteps = 100;
- m_nTransitionEffectStyle = EFX_EFFECT_ELLIPSE_C_IN;
- m_nTransitionEffectGrain = 10;
- m_nTransitionEffectDelay = 0;
- m_nTransitionEffectMaxPass = 1;
- m_nTransitionEffectTransparent = 0;
- m_nTransitionEffectTransparentColor = RGB(128, 128, 128);
- m_nTransitionEffectWandWidth = 0;
- m_nTransitionEffectWandColor = RGB(0, 128, 0);
-
- m_nShapeStyle = EFX_SHAPE_STAR5;
- m_nShapeBackStyle = EFX_BACKSTYLE_TRANSPARENT;
- m_nShapeFillStyle = DRAWFILLSTYLE_UPWARD_DIAGONAL;
- m_nShapeBorderColor = RGB(192, 192, 192);
- m_nShapeBorderStyle = EFX_BORDERSTYLE_SOLID;
- m_nShapeBorderWidth = 3;
- m_nShapeInnerStyle = EFX_INNERSTYLE_INSET;
- m_nShapeInnerWidth = 3;
- m_nShapeInnerHiliteColor = RGB(255, 255, 255);
- m_nShapeInnerShadowColor = RGB(128, 128, 128);
- m_nShapeOuterStyle = EFX_OUTERSTYLE_RAISED;
- m_nShapeOuterWidth = 3;
- m_nShapeOuterHiliteColor = RGB(255, 255, 255);
- m_nShapeOuterShadowColor = RGB(128, 128, 128);
- m_nShapeShadowXDepth = 5;
- m_nShapeShadowYDepth = 5;
- m_nShapeShadowColor = RGB(0, 0, 0);
- m_nShapeForeColor = RGB(255, 0, 0);
- m_nShapeBackColor = RGB(0, 0, 255);
-
- m_strTextSample = CString("LEAD Tools");
- m_nTextAngle = 0;
- m_nTextStyle = EFX_TEXTSTYLE_OUTLINEBLOCK;
- m_nTextAlign = EFX_TEXTALIGN_HCENTER_VCENTER;
- m_nTextWordWrap = 1;
- m_nTextColor = RGB(255, 0, 0);
- m_nTextHiliteColor = RGB(255, 255, 255);
- m_nTextShadowColor = RGB(0, 0, 0);
- m_nTextShadowXDepth = 5;
- m_nTextShadowYDepth = 5;
- m_nTextUseForegroundImage = 0;
- m_oleTextFont = m_LeadDlg.GetFont();
-
- CY cySize;
- cySize = m_oleTextFont.GetSize();
- cySize.Lo *= 5;
- m_oleTextFont.SetSize(cySize);
-
- UNLOCKSUPPORT(m_Lead);
- UNLOCKSUPPORT(m_LeadShape);
- UNLOCKSUPPORT(m_LeadText);
-
- m_nFileIndex = 0;
-
- m_Lead.SetEnableMethodErrors(FALSE);
- m_Lead.SetAutoRepaint(FALSE);
- m_Lead.SetAutoScroll(TRUE);
- m_Lead.SetBackErase(FALSE);
- m_Lead.SetEnableProgressEvent(FALSE);
- m_Lead.SetPaintSizeMode(PAINTSIZEMODE_STRETCH);
- m_Lead.SetScaleMode(3);
-
- m_LeadShape.SetEnableMethodErrors(FALSE);
- m_LeadShape.SetAutoRepaint(FALSE);
- m_LeadShape.SetAutoScroll(TRUE);
- m_LeadShape.SetBackErase(FALSE);
- m_LeadShape.SetEnableProgressEvent(FALSE);
- m_LeadShape.SetPaintSizeMode(PAINTSIZEMODE_NORMAL);
- m_LeadShape.SetScaleMode(3);
- m_LeadShape.ShowWindow(SW_HIDE);
-
- m_LeadText.SetEnableMethodErrors(FALSE);
- m_LeadText.SetAutoRepaint(FALSE);
- m_LeadText.SetAutoScroll(TRUE);
- m_LeadText.SetBackErase(FALSE);
- m_LeadText.SetEnableProgressEvent(FALSE);
- m_LeadText.SetPaintSizeMode(PAINTSIZEMODE_NORMAL);
- m_LeadText.SetScaleMode(3);
- m_LeadText.ShowWindow(SW_HIDE);
-
- m_LeadDlg.SetEnableMethodErrors(FALSE);
-
- return TRUE; // return TRUE unless you set the focus to a control
- }
-
- void CFxDemoDlg::OnEffect()
- {
- int nResult;
- CRect rcRect;
-
- m_LeadDlg.SetEffect(m_nEffectStyle);
- m_LeadDlg.SetGrain(m_nEffectGrain);
- m_LeadDlg.SetDelay(m_nEffectDelay);
- m_LeadDlg.SetMaxPass(m_nEffectMaxPass);
- m_LeadDlg.SetTransparent(m_nEffectTransparent);
- m_LeadDlg.SetTransparentColor(m_nEffectTransparentColor);
- m_LeadDlg.SetWandWidth(m_nEffectWandWidth);
- m_LeadDlg.SetWandColor(m_nEffectWandColor);
-
- m_LeadDlg.SetUIFlags(DLG_EFX_SHOWPREVIEW |
- DLG_EFX_DELAY |
- DLG_EFX_GRAIN |
- DLG_EFX_PASSES |
- DLG_EFX_TRANSPARENT |
- DLG_EFX_WAND |
- DLG_EFX_CLASS_NONE |
- DLG_EFX_CLASS_WIPE |
- DLG_EFX_CLASS_WIPERECT |
- DLG_EFX_CLASS_WIPECIRCLE |
- DLG_EFX_CLASS_PUSH |
- DLG_EFX_CLASS_SLIDE |
- DLG_EFX_CLASS_ROLL |
- DLG_EFX_CLASS_ROTATE |
- DLG_EFX_CLASS_ZOOM |
- DLG_EFX_CLASS_DRIP |
- DLG_EFX_CLASS_BLIND |
- DLG_EFX_CLASS_RANDOM |
- DLG_EFX_CLASS_CHECK |
- DLG_EFX_CLASS_BLOCKS |
- DLG_EFX_CLASS_CIRCLE |
- DLG_EFX_CLASS_ELLIPSE);
-
- m_LeadDlg.SetBitmap(m_Lead.GetBitmap());
-
- nResult = m_LeadDlg.GetEffect((long)this->m_hWnd);
- if (nResult == 0)
- {
- m_nEffectStyle = m_LeadDlg.GetEffect();
- m_nEffectGrain = m_LeadDlg.GetGrain();
- m_nEffectDelay = m_LeadDlg.GetDelay();
- m_nEffectMaxPass = m_LeadDlg.GetMaxPass();
- m_nEffectTransparent = m_LeadDlg.GetTransparent();
- m_nEffectTransparentColor = m_LeadDlg.GetTransparentColor();
- m_nEffectWandWidth = m_LeadDlg.GetWandWidth();
- m_nEffectWandColor = m_LeadDlg.GetWandColor();
-
- GetWindowRect(rcRect);
- InvalidateRect(rcRect, FALSE);
- }
- }
-
- void CFxDemoDlg::OnTransition()
- {
- int nResult;
- CRect rcRect;
-
- m_LeadDlg.SetTransition(m_nTransitionStyle);
- m_LeadDlg.SetForeColor(m_nTransitionForeColor);
- m_LeadDlg.SetBackColor(m_nTransitionBackColor);
- m_LeadDlg.SetGradientSteps(m_nTransitionSteps);
- m_LeadDlg.SetEffect(m_nTransitionEffectStyle);
- m_LeadDlg.SetGrain(m_nTransitionEffectGrain);
- m_LeadDlg.SetDelay(m_nTransitionEffectDelay);
- m_LeadDlg.SetMaxPass(m_nTransitionEffectMaxPass);
- m_LeadDlg.SetTransparent(m_nTransitionEffectTransparent);
- m_LeadDlg.SetTransparentColor(m_nTransitionEffectTransparentColor);
- m_LeadDlg.SetWandWidth(m_nTransitionEffectWandWidth);
- m_LeadDlg.SetWandColor(m_nTransitionEffectWandColor);
-
- m_LeadDlg.SetUIFlags(DLG_TRANS_SHOWPREVIEW |
- DLG_TRANS_FORECOLOR |
- DLG_TRANS_BACKCOLOR |
- DLG_TRANS_DELAY |
- DLG_TRANS_GRAIN |
- DLG_TRANS_EFFECT |
- DLG_TRANS_PASSES |
- DLG_TRANS_WAND |
- DLG_TRANS_TRANSPARENT |
- DLG_TRANS_GRADIENT);
-
- m_LeadDlg.SetBitmap(m_Lead.GetBitmap());
-
- nResult = m_LeadDlg.GetTransition((long)this->m_hWnd);
- if (nResult == 0)
- {
- m_nTransitionStyle = m_LeadDlg.GetTransition();
- m_nTransitionForeColor = m_LeadDlg.GetForeColor();
- m_nTransitionBackColor = m_LeadDlg.GetBackColor();
- m_nTransitionSteps = m_LeadDlg.GetGradientSteps();
- m_nTransitionEffectStyle = m_LeadDlg.GetEffect();
- m_nTransitionEffectGrain = m_LeadDlg.GetGrain();
- m_nTransitionEffectDelay = m_LeadDlg.GetDelay();
- m_nTransitionEffectMaxPass = m_LeadDlg.GetMaxPass();
- m_nTransitionEffectTransparent = m_LeadDlg.GetTransparent();
- m_nTransitionEffectTransparentColor = m_LeadDlg.GetTransparentColor();
- m_nTransitionEffectWandWidth = m_LeadDlg.GetWandWidth();
- m_nTransitionEffectWandColor = m_LeadDlg.GetWandColor();
-
- m_ShowTransition.SetCheck(TRUE);
-
- GetWindowRect(rcRect);
- InvalidateRect(rcRect, FALSE);
- }
- }
-
- void CFxDemoDlg::OnShape()
- {
- int nResult;
- CRect rcRect;
-
- m_LeadDlg.SetShape(m_nShapeStyle);
- m_LeadDlg.SetShapeBackStyle(m_nShapeBackStyle);
- m_LeadDlg.SetShapeFillStyle(m_nShapeFillStyle);
- m_LeadDlg.SetShapeBorderColor(m_nShapeBorderColor);
- m_LeadDlg.SetShapeBorderStyle(m_nShapeBorderStyle);
- m_LeadDlg.SetShapeBorderWidth(m_nShapeBorderWidth);
- m_LeadDlg.SetShapeInnerStyle(m_nShapeInnerStyle);
- m_LeadDlg.SetShapeInnerWidth(m_nShapeInnerWidth);
- m_LeadDlg.SetShapeInnerHiliteColor(m_nShapeInnerHiliteColor);
- m_LeadDlg.SetShapeInnerShadowColor(m_nShapeInnerShadowColor);
- m_LeadDlg.SetShapeOuterStyle(m_nShapeOuterStyle);
- m_LeadDlg.SetShapeOuterWidth(m_nShapeOuterWidth);
- m_LeadDlg.SetShapeOuterHiliteColor(m_nShapeOuterHiliteColor);
- m_LeadDlg.SetShapeOuterShadowColor(m_nShapeOuterShadowColor);
- m_LeadDlg.SetShadowXDepth(m_nShapeShadowXDepth);
- m_LeadDlg.SetShadowYDepth(m_nShapeShadowYDepth);
- m_LeadDlg.SetShadowColor(m_nShapeShadowColor);
- m_LeadDlg.SetForeColor(m_nShapeForeColor);
- m_LeadDlg.SetBackColor(m_nShapeBackColor);
-
- m_LeadDlg.SetUIFlags(DLG_SHAPE_SHOWPREVIEW |
- DLG_SHAPE_BACKSTYLE |
- DLG_SHAPE_FILLSTYLE |
- DLG_SHAPE_FORE_BACK_COLOR |
- DLG_SHAPE_BORDERSTYLE |
- DLG_SHAPE_BORDERWIDTH |
- DLG_SHAPE_BORDERCOLOR |
- DLG_SHAPE_INNERSTYLE |
- DLG_SHAPE_INNERWIDTH |
- DLG_SHAPE_INNER_HILITE_SHADOW |
- DLG_SHAPE_OUTERSTYLE |
- DLG_SHAPE_OUTERWIDTH |
- DLG_SHAPE_OUTER_HILITE_SHADOW |
- DLG_SHAPE_SHADOWCOLOR |
- DLG_SHAPE_SHADOW_X_Y |
- DLG_SHAPE_BROWSEIMAGE |
- DLG_SHAPE_CLASS_SQUARE |
- DLG_SHAPE_CLASS_RECTANGLE |
- DLG_SHAPE_CLASS_PARALLELOGRAM |
- DLG_SHAPE_CLASS_TRAPEZOID |
- DLG_SHAPE_CLASS_TRIANGLE |
- DLG_SHAPE_CLASS_OTHER |
- DLG_SHAPE_CLASS_CIRCLE |
- DLG_SHAPE_CLASS_ELLIPSE |
- DLG_SHAPE_CLASS_STAR |
- DLG_SHAPE_CLASS_CROSS |
- DLG_SHAPE_CLASS_ARROW);
-
- m_LeadDlg.SetBitmap(m_Lead.GetBitmap());
- m_LeadDlg.SetShapeBackgroundBitmap(m_LeadShape.GetBitmap());
-
- nResult = m_LeadDlg.Get3dShape((long)this->m_hWnd);
- if (nResult == 0)
- {
- m_nShapeStyle = m_LeadDlg.GetShape();
- m_nShapeBackStyle = m_LeadDlg.GetShapeBackStyle();
- m_nShapeFillStyle = m_LeadDlg.GetShapeFillStyle();
- m_nShapeBorderColor = m_LeadDlg.GetShapeBorderColor();
- m_nShapeBorderStyle = m_LeadDlg.GetShapeBorderStyle();
- m_nShapeBorderWidth = m_LeadDlg.GetShapeBorderWidth();
- m_nShapeInnerStyle = m_LeadDlg.GetShapeInnerStyle();
- m_nShapeInnerWidth = m_LeadDlg.GetShapeInnerWidth();
- m_nShapeInnerHiliteColor = m_LeadDlg.GetShapeInnerHiliteColor();
- m_nShapeInnerShadowColor = m_LeadDlg.GetShapeInnerShadowColor();
- m_nShapeOuterStyle = m_LeadDlg.GetShapeOuterStyle();
- m_nShapeOuterWidth = m_LeadDlg.GetShapeOuterWidth();
- m_nShapeOuterHiliteColor = m_LeadDlg.GetShapeOuterHiliteColor();
- m_nShapeOuterShadowColor = m_LeadDlg.GetShapeOuterShadowColor();
- m_nShapeShadowXDepth = m_LeadDlg.GetShadowXDepth();
- m_nShapeShadowYDepth = m_LeadDlg.GetShadowYDepth();
- m_nShapeShadowColor = m_LeadDlg.GetShadowColor();
- m_nShapeForeColor = m_LeadDlg.GetForeColor();
- m_nShapeBackColor = m_LeadDlg.GetBackColor();
- m_LeadShape.SetBitmap(m_LeadDlg.GetShapeBackgroundBitmap());
- m_LeadShape.Size(m_Lead.GetScaleWidth(), m_Lead.GetScaleHeight(), RESIZE_NORMAL);
-
- m_ShowShape.SetCheck(TRUE);
-
- GetWindowRect(rcRect);
- InvalidateRect(rcRect, FALSE);
- }
- }
-
- void CFxDemoDlg::OnText()
- {
- int nResult;
- CRect rcRect;
-
- m_LeadDlg.SetSampleText((LPCTSTR)m_strTextSample);
- m_LeadDlg.SetTextStyle(m_nTextStyle);
- m_LeadDlg.SetTextAlign(m_nTextAlign);
- m_LeadDlg.SetTextWordWrap(m_nTextWordWrap);
- m_LeadDlg.SetTextColor(m_nTextColor);
- m_LeadDlg.SetTextHiliteColor(m_nTextHiliteColor);
- m_LeadDlg.SetTextUseForegroundImage(m_nTextUseForegroundImage);
- m_LeadDlg.SetShadowXDepth(m_nTextShadowXDepth);
- m_LeadDlg.SetShadowYDepth(m_nTextShadowYDepth);
- m_LeadDlg.SetShadowColor(m_nTextShadowColor);
- m_LeadDlg.SetAngle(m_nTextAngle);
- m_LeadDlg.SetFont(m_oleTextFont);
-
- m_LeadDlg.SetUIFlags(DLG_TEXT_SHOWPREVIEW |
- DLG_TEXT_SAMPLETEXT |
- DLG_TEXT_STYLE |
- DLG_TEXT_COLOR |
- DLG_TEXT_BORDERCOLOR |
- DLG_TEXT_ALIGN |
- DLG_TEXT_ANGLE |
- DLG_TEXT_WORDWRAP |
- DLG_TEXT_FONT |
- DLG_TEXT_FOREIMAGE |
- DLG_TEXT_BROWSEIMAGE |
- DLG_TEXT_SHADOWCOLOR |
- DLG_TEXT_SHADOW_X_Y);
-
- m_LeadDlg.SetBitmap(m_Lead.GetBitmap());
- m_LeadDlg.SetTextForegroundBitmap(m_LeadText.GetBitmap());
-
- nResult = m_LeadDlg.Get3dText((long)this->m_hWnd);
- if (nResult == 0)
- {
- m_strTextSample = m_LeadDlg.GetSampleText();
- m_nTextStyle = m_LeadDlg.GetTextStyle();
- m_nTextAlign = m_LeadDlg.GetTextAlign();
- m_nTextWordWrap = m_LeadDlg.GetTextWordWrap();
- m_nTextColor = m_LeadDlg.GetTextColor();
- m_nTextHiliteColor = m_LeadDlg.GetTextHiliteColor();
- m_nTextUseForegroundImage = m_LeadDlg.GetTextUseForegroundImage();
- m_nTextShadowXDepth = m_LeadDlg.GetShadowXDepth();
- m_nTextShadowYDepth = m_LeadDlg.GetShadowYDepth();
- m_nTextShadowColor = m_LeadDlg.GetShadowColor();
- m_nTextAngle = m_LeadDlg.GetAngle();
- m_oleTextFont = m_LeadDlg.GetFont();
- m_LeadText.SetBitmap(m_LeadDlg.GetTextForegroundBitmap());
- m_LeadText.Size(m_Lead.GetScaleWidth(), m_Lead.GetScaleHeight(), RESIZE_NORMAL);
-
- m_ShowText.SetCheck(TRUE);
-
- GetWindowRect(rcRect);
- InvalidateRect(rcRect, FALSE);
- }
- }
-
- void CFxDemoDlg::OnShow()
- {
- int nResult;
-
- //-----Begin Transition------------------------------------------------------
-
- if (m_ShowTransition.GetCheck())
- {
- if (m_nTransitionStyle <= EFX_PATTERN_MAX)
- {
- m_Lead.SetTransitionStyle(EFX_TRANSITION_PATTERN);
-
- if (m_nTransitionStyle == EFX_PATTERN_SOLID)
- {
- m_Lead.SetPatternStyle(m_nTransitionStyle);
- }
- else
- {
- m_Lead.SetPatternStyle(m_nTransitionStyle+1);
- }
- m_Lead.SetPatternForeColor(m_nTransitionForeColor);
- m_Lead.SetPatternBackColor(m_nTransitionBackColor);
- }
- else
- {
- m_Lead.SetTransitionStyle(EFX_TRANSITION_GRADIENT);
- m_Lead.SetGradientStyle(m_nTransitionStyle);
- m_Lead.SetGradientStartColor(m_nTransitionForeColor);
- m_Lead.SetGradientEndColor(m_nTransitionBackColor);
- m_Lead.SetGradientSteps(m_nTransitionSteps);
- }
-
- m_Lead.SetTransitionEffect(m_nTransitionEffectStyle);
- m_Lead.SetEffectGrain(m_nTransitionEffectGrain);
- m_Lead.SetEffectDelay(m_nTransitionEffectDelay);
- m_Lead.SetPaintMaxPasses(m_nTransitionEffectMaxPass);
- m_Lead.SetUseTransparentColor(m_nTransitionEffectTransparent);
- m_Lead.SetTransparentColor(m_nTransitionEffectTransparentColor);
- m_Lead.SetWandSize(m_nTransitionEffectWandWidth);
- m_Lead.SetWandColor(m_nTransitionEffectWandColor);
- }
- else
- {
- m_Lead.SetTransitionEffect(EFX_EFFECT_NONE);
- m_Lead.SetTransitionStyle(EFX_TRANSITION_NONE);
- }
-
- //-----End Transition--------------------------------------------------------
-
- //-----Begin Effect----------------------------------------------------------
-
- if (m_nFileIndex >= sizeof(szFileName) / sizeof(szFileName[0]))
- {
- m_nFileIndex = 0;
- }
-
- nResult = m_Lead.Load(szFileName[m_nFileIndex], 0, 0, 1);
- if (nResult != 0)
- {
- AfxMessageBox("Please change the filenames.");
- return;
- }
-
- m_nFileIndex++;
-
- m_Lead.SetPaintEffect(m_nEffectStyle);
- m_Lead.SetEffectGrain(m_nEffectGrain);
- m_Lead.SetEffectDelay(m_nEffectDelay);
- m_Lead.SetPaintMaxPasses(m_nEffectMaxPass);
- m_Lead.SetUseTransparentColor(m_nEffectTransparent);
- m_Lead.SetTransparentColor(m_nEffectTransparentColor);
- m_Lead.SetWandSize(m_nEffectWandWidth);
- m_Lead.SetWandColor(m_nEffectWandColor);
-
- m_Lead.ForceRepaint();
-
- //-----End Effect------------------------------------------------------------
-
- //-----Begin Shape-----------------------------------------------------------
-
- if (m_ShowShape.GetCheck())
- {
- m_Lead.SetShapeLeft(0.0f);
- m_Lead.SetShapeTop(0.0f);
- m_Lead.SetShapeWidth((float)m_Lead.GetScaleWidth());
- m_Lead.SetShapeHeight((float)m_Lead.GetScaleHeight());
-
- m_Lead.SetShapeBorderThickness(m_nShapeBorderWidth);
- m_Lead.SetShapeBorderColor(m_nShapeBorderColor);
-
- m_Lead.SetShapeInnerBandStyle(m_nShapeInnerStyle);
- m_Lead.SetShapeInnerBandThickness(m_nShapeInnerWidth);
- m_Lead.SetShapeInnerBandHiliteColor(m_nShapeInnerHiliteColor);
- m_Lead.SetShapeInnerBandShadowColor(m_nShapeInnerShadowColor);
-
- m_Lead.SetShapeOuterBandStyle(m_nShapeOuterStyle);
- m_Lead.SetShapeOuterBandThickness(m_nShapeOuterWidth);
- m_Lead.SetShapeOuterBandHiliteColor(m_nShapeOuterHiliteColor);
- m_Lead.SetShapeOuterBandShadowColor(m_nShapeOuterShadowColor);
-
- m_Lead.SetShapeBackgroundStyle(m_nShapeBackStyle);
-
- m_Lead.SetShapeBorderStyle(m_nShapeBorderStyle);
-
- m_Lead.SetShadowXDepth(m_nShapeShadowXDepth);
- m_Lead.SetShadowYDepth(m_nShapeShadowYDepth);
- m_Lead.SetShadowColor(m_nShapeShadowColor);
-
- m_Lead.SetBackgroundImageLeft(0.0f);
- m_Lead.SetBackgroundImageTop(0.0f);
- m_Lead.SetBackgroundImageWidth((float)m_Lead.GetScaleWidth());
- m_Lead.SetBackgroundImageHeight((float)m_Lead.GetScaleHeight());
-
- if (m_nShapeFillStyle < EFX_PATTERN_MAX)
- {
- m_Lead.SetTransitionStyle(EFX_TRANSITION_PATTERN);
- m_Lead.SetPatternStyle(m_nShapeFillStyle);
- m_Lead.SetPatternForeColor(m_nShapeForeColor);
- m_Lead.SetPatternBackColor(m_nShapeBackColor);
- }
- else
- {
- m_Lead.SetTransitionStyle(EFX_TRANSITION_GRADIENT);
- m_Lead.SetGradientStyle(m_nShapeFillStyle);
- m_Lead.SetGradientStartColor(m_nShapeForeColor);
- m_Lead.SetGradientEndColor(m_nShapeBackColor);
- }
-
- m_Lead.DrawShape(m_nShapeStyle, m_LeadShape.GetBitmap());
- }
-
- //-----End Shape-------------------------------------------------------------
-
- //-----Begin Text------------------------------------------------------------
-
- if (m_ShowText.GetCheck())
- {
- m_Lead.SetFont(m_oleTextFont);
-
- m_Lead.SetTextLeft(m_Lead.GetScaleWidth() * 0.1f);
- m_Lead.SetTextTop(m_Lead.GetScaleHeight() * 0.1f);
- m_Lead.SetTextWidth(m_Lead.GetScaleWidth() * 0.8f);
- m_Lead.SetTextHeight(m_Lead.GetScaleHeight() * 0.8f);
- m_Lead.SetTextAngle((short)m_nTextAngle);
- m_Lead.SetTextStyle(m_nTextStyle);
- m_Lead.SetTextAlign(m_nTextAlign);
- m_Lead.SetTextWordWrap(m_nTextWordWrap);
- m_Lead.SetTextHiliteColor(m_nTextHiliteColor);
-
- m_Lead.SetDrawFontColor(m_nTextColor);
-
- m_Lead.SetShadowXDepth(m_nTextShadowXDepth);
- m_Lead.SetShadowYDepth(m_nTextShadowYDepth);
- m_Lead.SetShadowColor(m_nTextShadowColor);
-
- if (m_nTextUseForegroundImage)
- {
- m_Lead.DrawText((LPCTSTR)m_strTextSample, m_LeadText.GetBitmap());
- }
- else
- {
- m_Lead.DrawText((LPCTSTR)m_strTextSample, 0);
- }
- }
-
- //-----End Text--------------------------------------------------------------
- }
-
- void CFxDemoDlg::OnPaint()
- {
- CPaintDC dc(this); // device context for painting
-
- OnShow();
- }
-