Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Help drawing vertical text

Help drawing vertical text

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsadobehelptutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Juan Carlos Cobas
    wrote on last edited by
    #1

    Hi, I have an application that draws text vertically. This application uses the MM_TWIPS mapping mode. Everything works fine except when I try to copy the text into the clipboard as a metafile. In this case, when the metafile is pasted into MS Word 2002 (XP), the metafile is pasted correctly. However, when the metafile is pasted into MS Word 2000, or into another apps such as Photoshop, the text is rotated by an additional 180º. For example, if the text rendered in the screen is: S A M P L E It's converted into E L P M A S when pasted as a metafile in Office 2000 apps or photoshop. This does not happen if the mapping mode is MM_TEXT. However, my application is strongly based on MM_TWIPS mode. This is some sample code: void CTestView::OnDraw(CDC* pDC) { // Set mapping mode pDC->SetMapMode( MM_TWIPS ); CFont font; LOGFONT lf; ZeroMemory( &lf, sizeof(LOGFONT) ); lstrcpy( lf.lfFaceName, "Arial" ); lf.lfEscapement = 900; font.CreateFontIndirect( &lf ); CFont* pOldFont = pDC->SelectObject(&font); pDC->TextOut(1100, -1100, "Sample Vertical Text"); pDC->SelectObject(pOldFont); } void CTestView::OnEditCopy() { CMetaFileDC * m_pMetaDC = new CMetaFileDC(); //draw meta file CClientDC clientDC(this); OnPrepareDC(&clientDC); m_pMetaDC->CreateEnhanced(&clientDC,NULL,NULL,"Metafile"); m_pMetaDC->m_hAttribDC = clientDC.m_hDC; m_pMetaDC->m_bPrinting = true; OnDraw(m_pMetaDC); //close meta file dc and prepare for clipboard; HENHMETAFILE hMF = m_pMetaDC->CloseEnhanced(); //copy to clipboard OpenClipboard(); EmptyClipboard(); ::SetClipboardData(CF_ENHMETAFILE,hMF); CloseClipboard(); //DeleteMetaFile(hMF); delete m_pMetaDC; }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups