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 text

Rotation text

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
6 Posts 4 Posters 1 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.
  • D Offline
    D Offline
    duvaft
    wrote on last edited by
    #1

    Can you help me abuot the text rotation like the behaviour in InDesign (text and cursor rotated). Can yuo send me an example? If the text is rotate also the cursor will be rotated. Thanks.:doh::doh::doh::doh:

    E E S 3 Replies Last reply
    0
    • D duvaft

      Can you help me abuot the text rotation like the behaviour in InDesign (text and cursor rotated). Can yuo send me an example? If the text is rotate also the cursor will be rotated. Thanks.:doh::doh::doh::doh:

      E Offline
      E Offline
      Eugene Pustovoyt
      wrote on last edited by
      #2

      Where do you want rotate text (screen, control and etc.)? Best regards, Eugene Pustovoyt


      ICQ UIN: 161325180

      1 Reply Last reply
      0
      • D duvaft

        Can you help me abuot the text rotation like the behaviour in InDesign (text and cursor rotated). Can yuo send me an example? If the text is rotate also the cursor will be rotated. Thanks.:doh::doh::doh::doh:

        E Offline
        E Offline
        EXTEIDE
        wrote on last edited by
        #3

        following is the CreateFontIndirect example in msdn. HFONT FAR PASCAL MyCreateFont( void ) {    CHOOSEFONT cf;    LOGFONT lf;    HFONT hfont;    // Initialize members of the CHOOSEFONT structure.    cf.lStructSize = sizeof(CHOOSEFONT);    cf.hwndOwner = (HWND)NULL;    cf.hDC = (HDC)NULL;    cf.lpLogFont = &lf;    cf.iPointSize = 0;    cf.Flags = CF_SCREENFONTS;    cf.rgbColors = RGB(0,0,0);    cf.lCustData = 0L;    cf.lpfnHook = (LPCFHOOKPROC)NULL;    cf.lpTemplateName = (LPSTR)NULL;    cf.hInstance = (HINSTANCE) NULL;    cf.lpszStyle = (LPSTR)NULL;    cf.nFontType = SCREEN_FONTTYPE;    cf.nSizeMin = 0;    cf.nSizeMax = 0;    cf.lfOrientation = 180; // specify angle that you want.    // Display the CHOOSEFONT common-dialog box.    ChooseFont(&cf);    // Create a logical font based on the user's    // selection and return a handle identifying    // that font.    hfont = CreateFontIndirect(cf.lpLogFont);    return (hfont); } Enjoy:rose: Anderson Sheen (exteide@gmail.com) The Extension IDE: http://www.exteide.com

        E 1 Reply Last reply
        0
        • E EXTEIDE

          following is the CreateFontIndirect example in msdn. HFONT FAR PASCAL MyCreateFont( void ) {    CHOOSEFONT cf;    LOGFONT lf;    HFONT hfont;    // Initialize members of the CHOOSEFONT structure.    cf.lStructSize = sizeof(CHOOSEFONT);    cf.hwndOwner = (HWND)NULL;    cf.hDC = (HDC)NULL;    cf.lpLogFont = &lf;    cf.iPointSize = 0;    cf.Flags = CF_SCREENFONTS;    cf.rgbColors = RGB(0,0,0);    cf.lCustData = 0L;    cf.lpfnHook = (LPCFHOOKPROC)NULL;    cf.lpTemplateName = (LPSTR)NULL;    cf.hInstance = (HINSTANCE) NULL;    cf.lpszStyle = (LPSTR)NULL;    cf.nFontType = SCREEN_FONTTYPE;    cf.nSizeMin = 0;    cf.nSizeMax = 0;    cf.lfOrientation = 180; // specify angle that you want.    // Display the CHOOSEFONT common-dialog box.    ChooseFont(&cf);    // Create a logical font based on the user's    // selection and return a handle identifying    // that font.    hfont = CreateFontIndirect(cf.lpLogFont);    return (hfont); } Enjoy:rose: Anderson Sheen (exteide@gmail.com) The Extension IDE: http://www.exteide.com

          E Offline
          E Offline
          Eugene Pustovoyt
          wrote on last edited by
          #4

          Try this:

          cf.lfEscapement = cf.lfOrientation = 180; // specify angle that you want.

          :) Best regards, Eugene Pustovoyt


          ICQ UIN: 161325180

          E 1 Reply Last reply
          0
          • E Eugene Pustovoyt

            Try this:

            cf.lfEscapement = cf.lfOrientation = 180; // specify angle that you want.

            :) Best regards, Eugene Pustovoyt


            ICQ UIN: 161325180

            E Offline
            E Offline
            EXTEIDE
            wrote on last edited by
            #5

            right. i've sold out lfEscapement.:-D Anderson Sheen (exteide@gmail.com) The Extension IDE: http://www.exteide.com

            1 Reply Last reply
            0
            • D duvaft

              Can you help me abuot the text rotation like the behaviour in InDesign (text and cursor rotated). Can yuo send me an example? If the text is rotate also the cursor will be rotated. Thanks.:doh::doh::doh::doh:

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

              Or to rotate basically anything at all (not just text):

              CPaintDC dc(this);
               
              int OldGMode = SetGraphicsMode(dc.m_hDC, GM_ADVANCED);
              static const double pi = 4*atan(1.0); // Gives up pi.
              static const double a = 30*(pi/180); // Angle in radians.
              XFORM xf = {cos(a), sin(a), -sin(a), cos(a), 0, 0};
              SetWorldTransform(dc.m_hDC, &xf);
               
              int OldBkMode = dc.SetBkMode(TRANSPARENT);
              dc.TextOut(0, 0, _T("This text is rotated."));
              dc.SetBkMode(OldBkMode);
              dc.Rectangle(100, 100, 200, 200);
               
              SetGraphicsMode(dc.m_hDC, OldGMode);
              

              NOTE: Doesn't work in 95/98/ME 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