Available in the LEADTOOLS Imaging toolkit. |
ShowTransitionDlg Example for C++ 5.0 and later
void CDialogs::OnShowTransitionDlg() { HRESULT hr; int nRet; ILEADRasterDlgKrn_U *m_pRasterDlgKrn = NULL; hr = CoCreateInstance(CLSID_LEADRasterDlgKrn_U, NULL, CLSCTX_ALL, IID_ILEADRasterDlgKrn_U, (LPVOID*)&m_pRasterDlgKrn); ILEADRasterDlgEfx_U *m_pRasterDlgEfx = NULL; hr = CoCreateInstance(CLSID_LEADRasterDlgEfx_U, NULL, CLSCTX_ALL, IID_ILEADRasterDlgEfx_U, (LPVOID*)&m_pRasterDlgEfx); nRet = m_pRasterDlgKrn->InitDlg(INIT_WITH_COLOR); m_pRasterDlgEfx->Transition->TransitionStyle = EFX_TRANSITION_NONE; m_pRasterDlgEfx->Transition->EffectStyle = EFX_EFFECT_WIPE_CIRCLE_CLASS; m_pRasterDlgEfx->Transition->ForeColor = RGB(255, 255, 0); m_pRasterDlgEfx->Transition->BackColor = RGB(255, 0, 255); m_pRasterDlgEfx->Transition->Steps = 120; m_pRasterDlgEfx->Transition->Delay = 20; m_pRasterDlgEfx->Transition->Grain = 5; m_pRasterDlgEfx->Transition->WandThickness = 5; m_pRasterDlgEfx->Transition->WandColor = RGB(255, 255, 0); m_pRasterDlgEfx->Transition->Transparent = TRUE; m_pRasterDlgEfx->Transition->TransparentColor = RGB(255, 0, 0); m_pRasterDlgEfx->UIFlags = TRANSITION_SHOW_PREVIEW | TRANSITION_FORECOLOR | TRANSITION_BACKCOLOR | TRANSITION_DELAY | TRANSITION_GRAIN | TRANSITION_EFFECT | TRANSITION_PASSES | TRANSITION_WAND | TRANSITION_TRANSPARENT | TRANSITION_GRADIENT; m_pRasterDlgEfx->Bitmap = m_pLead1.GetBitmap(); nRet = m_pRasterDlgEfx->ShowTransitionDlg((long)m_hWnd); if (nRet == 0 && m_pRasterDlgEfx->DialogStatus == DLG_OK) { CString csRes1; CString csRes2; CString csRes3; csRes1.Format(TEXT("Effect: %d\nGrain: %d\nDelay: %d\nMaxPass: %d\nTransparent: %d\n"), m_pRasterDlgEfx->Transition->TransitionStyle,//the property m_pRasterDlgEfx->Transition->Grain, m_pRasterDlgEfx->Transition->Delay, m_pRasterDlgEfx->Transition->MaxPass, m_pRasterDlgEfx->Transition->Transparent); csRes2.Format(TEXT("TransparentColor: %ld\nWandWidth: %d\nWandColor: %ld\n"), m_pRasterDlgEfx->Transition->TransparentColor, m_pRasterDlgEfx->Transition->WandThickness, m_pRasterDlgEfx->Transition->WandColor); csRes3.Format(TEXT("Transition: %d\nGradientSteps: %d\nBackColor: %ld\nForeColor: %ld"), m_pRasterDlgEfx->Transition->TransitionStyle, m_pRasterDlgEfx->Transition->Steps, m_pRasterDlgEfx->Transition->BackColor, m_pRasterDlgEfx->Transition->ForeColor); AfxMessageBox(csRes1 + csRes2 + csRes3); } }