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. Drawing Auto-adjusted proportioned text

Drawing Auto-adjusted proportioned text

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphics
5 Posts 3 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.
  • M Offline
    M Offline
    Muneeb Abdul Shakoor
    wrote on last edited by
    #1

    Hi! I have a Box with certain width and height. The box has to contain a certain text that should be visible inside the box no matter how long it is. So, if the text is too small then it should take as much space in the box as possible. Its size should be inversly proportional to the text length. But I have to maintain its actual characters proportion too. Any body who has ever done it in MFC. I am using VC 8

    K J 2 Replies Last reply
    0
    • M Muneeb Abdul Shakoor

      Hi! I have a Box with certain width and height. The box has to contain a certain text that should be visible inside the box no matter how long it is. So, if the text is too small then it should take as much space in the box as possible. Its size should be inversly proportional to the text length. But I have to maintain its actual characters proportion too. Any body who has ever done it in MFC. I am using VC 8

      K Offline
      K Offline
      KarstenK
      wrote on last edited by
      #2

      You should at first draw the text in a memory DC and than make StretchBlt to the wanted size. Read MFC class CDC.

      Greetings from Germany

      M 1 Reply Last reply
      0
      • K KarstenK

        You should at first draw the text in a memory DC and than make StretchBlt to the wanted size. Read MFC class CDC.

        Greetings from Germany

        M Offline
        M Offline
        Muneeb Abdul Shakoor
        wrote on last edited by
        #3

        But how to draw text in the DC memory?

        modified on Thursday, October 16, 2008 6:38 AM

        K 1 Reply Last reply
        0
        • M Muneeb Abdul Shakoor

          But how to draw text in the DC memory?

          modified on Thursday, October 16, 2008 6:38 AM

          K Offline
          K Offline
          KarstenK
          wrote on last edited by
          #4

          CDC::DrawText() Try considering to read the MSDN, or google "cdc and mfc". :mad:

          Greetings from Germany

          1 Reply Last reply
          0
          • M Muneeb Abdul Shakoor

            Hi! I have a Box with certain width and height. The box has to contain a certain text that should be visible inside the box no matter how long it is. So, if the text is too small then it should take as much space in the box as possible. Its size should be inversly proportional to the text length. But I have to maintain its actual characters proportion too. Any body who has ever done it in MFC. I am using VC 8

            J Offline
            J Offline
            Jose David Pujo
            wrote on last edited by
            #5

            I think that there isn't any GDI API function to make such job. try this link: http://msdn.microsoft.com/es-es/library/4acfw2ha(VS.80).aspx#_mfc_cdc_text_functions[^]

            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