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. Rotation of multiline text

Rotation of multiline text

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 2 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.
  • S Offline
    S Offline
    Shailesh Ha
    wrote on last edited by
    #1

    My problem is that when i rotate my multiline text 180 degrees , the text is rotated but the ordering of lines in the text is wrong as the first line comes as last and last line comes as first(for eg. if i have two lines line1 & line2 then after rotation line2 is displayed and below it line1 is diaplayed).I have passed the DT_WORDBREAK as parameter to the CDC drawtext function to handle word wrapping. Is ther any other way to handle rotation of multiline text? Kindly let me know

    S 1 Reply Last reply
    0
    • S Shailesh Ha

      My problem is that when i rotate my multiline text 180 degrees , the text is rotated but the ordering of lines in the text is wrong as the first line comes as last and last line comes as first(for eg. if i have two lines line1 & line2 then after rotation line2 is displayed and below it line1 is diaplayed).I have passed the DT_WORDBREAK as parameter to the CDC drawtext function to handle word wrapping. Is ther any other way to handle rotation of multiline text? Kindly let me know

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      The following example shows how to rotate text at any angle (doesn't work on 95/98/ME). It renders text at (50, 50) rotated 30 degress clockwise. -------------------------------------- CPaintDC dc(this); int OldMode = SetGraphicsMode(dc.m_hDC, GM_ADVANCED); static const double pi = 4.0*atan(1.0); static const double angle = 30.0*(pi/180.0); static const XFORM xf = {cos(angle), sin(angle), -sin(angle), cos(angle), 0, 0}; SetWorldTransform(dc.m_hDC, &xf); CRect rcClient; GetClientRect(&rcClient); rcClient += CPoint(50, 50); dc.DrawText(_T("Hello\nThere"), -1, &rcClient, 0); SetGraphicsMode(dc.m_hDC, OldMode); -------------------------------------- Steve

      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