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. CDC::DrawText() vs TextOur()

CDC::DrawText() vs TextOur()

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studiocomgraphicsjsonquestion
4 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.
  • A Offline
    A Offline
    adamUK
    wrote on last edited by
    #1

    I am drawing directly on to a dialog and for some reason in the OnPaint() handler, if I use TextOut, text draws okay. If I replace the statement with DrawText() nothing appears. This is with DT_NOCLIP|DT_CALCRECT|DT_SINGLELINE as options. It is me or is there something deeper afoot? I am using W2K SP3 and VC6. thanks Adam. My world tour What I do now.. "I spent a lot of my money on booze, birds and fast cars. The rest I just squandered" George Best. "I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.

    P 1 Reply Last reply
    0
    • A adamUK

      I am drawing directly on to a dialog and for some reason in the OnPaint() handler, if I use TextOut, text draws okay. If I replace the statement with DrawText() nothing appears. This is with DT_NOCLIP|DT_CALCRECT|DT_SINGLELINE as options. It is me or is there something deeper afoot? I am using W2K SP3 and VC6. thanks Adam. My world tour What I do now.. "I spent a lot of my money on booze, birds and fast cars. The rest I just squandered" George Best. "I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.

      P Offline
      P Offline
      PJ Arends
      wrote on last edited by
      #2

      From MSDN: DT_CALCRECT Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the lpRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text.


      [

      ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

      A 1 Reply Last reply
      0
      • P PJ Arends

        From MSDN: DT_CALCRECT Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the lpRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text.


        [

        ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

        A Offline
        A Offline
        adamUK
        wrote on last edited by
        #3

        So it was me after all... my inability to read!! Sheesh. Thanks!! Adam. My world tour What I do now.. "I spent a lot of my money on booze, birds and fast cars. The rest I just squandered" George Best. "I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.

        T 1 Reply Last reply
        0
        • A adamUK

          So it was me after all... my inability to read!! Sheesh. Thanks!! Adam. My world tour What I do now.. "I spent a lot of my money on booze, birds and fast cars. The rest I just squandered" George Best. "I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.

          T Offline
          T Offline
          Tim Smith
          wrote on last edited by
          #4

          Heh, don't feel bad. It bites me every time I use that feature. Tim Smith I'm going to patent thought. I have yet to see any prior art.

          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