ShowTextDlg Example for C++ 5.0 and later

void CDialogs::OnShowTextDlg()
{
   int nRet; 
   m_pRasterEfxDlg->Text->ForegroundBitmap= m_LeadRasterView2.GetRaster(). ();
   m_pRasterEfxDlg->Text->SampleText= "LEAD TOOLS";
   m_pRasterEfxDlg->Text->HiliteColor= RGB ( 255,255,255 ); 
   m_pRasterEfxDlg->Text->ShadowColor= RGB ( 128,128,128 ); 
   m_pRasterEfxDlg->Text->TextStyle= FXD_TEXTSTYLE_NORMAL; 
   m_pRasterEfxDlg->Text->Align
FXD_TEXTALIGN_LEFT_TOP; 
   m_pRasterEfxDlg->Text->WordWrap= false; 
   m_pRasterEfxDlg->Text->Angle= 450; 
   m_pRasterEfxDlg->Text->ShadowXDepth= 10; 
   m_pRasterEfxDlg->Text->ShadowYDepth= 10; 
   m_pRasterEfxDlg->Text->EnableUseForegroundImage= true; 
   m_pRasterEfxDlg->UIFlags= TEXT_SHOW_PREVIEW |
                              TEXT_AUTOPREVIEW  |
                              TEXT_SAMPLETEXT   |
                              TEXT_STYLE        |
                              TEXT_COLOR        |
                              TEXT_BORDERCOLOR  |
                              TEXT_ALIGN        |
                              TEXT_ANGLE        |
                              TEXT_WORDWRAP     |
                              TEXT_FONT         |
                              TEXT_FOREIMAGE    |
                              TEXT_BROWSEIMAGE  |
                              TEXT_SHADOWCOLOR  |
                              TEXT_SHADOW_X_Y; 

   m_pRasterEfxDlg->Bitmap = m_LeadRasterView.GetRaster (). ();
   nRet =m_pRasterEfxDlg->ShowTextDlg((long)this->m_hWnd); 
   if ( nRet == 0 && m_pRasterEfxDlg->DialogStatus ==DLG_OK ) 
   {
      CString csRes1; 
      CString csRes2; 
      CString csRes3; 

      csRes1.Format(TEXT("SampleText: %s\nAngle: %ld\nTextStyle: %d\nTextAlign: %d\n"),
                     (LPCSTR)m_pRasterEfxDlg->Text->SampleText
                     m_pRasterEfxDlg->Text->Angle
                     m_pRasterEfxDlg->Text->TextStyle
                     m_pRasterEfxDlg->Text->Align); 
      
      csRes2.Format(TEXT("WordWrap: %d\nUseForeImage: %d\n"),
                     m_pRasterEfxDlg->Text->WordWrap
                     m_pRasterEfxDlg->Text->EnableUseForegroundImage
                     ); 
      
      csRes3.Format(TEXT("ShadowX: %d\nShadowY: %d\nShadowColor: %ld\nTextColor: %ld\nHiliteColor: %ld"),
                     m_pRasterEfxDlg->Text->ShadowXDepth
                     m_pRasterEfxDlg->Text->ShadowYDepth
                     m_pRasterEfxDlg->Text->ShadowColor
                     m_pRasterEfxDlg->Text->Color
                     m_pRasterEfxDlg->Text->HiliteColor); 

      AfxMessageBox(csRes1 + csRes2 + csRes3); 

      m_LeadRasterView2.GetRaster().SetBitmap (m_pRasterEfxDlg->Text->ForegroundBitmap); 
   }