No announcement yet.

Print text in all direction

  • Filter
  • Time
  • Show
Clear All
new posts

  • Print text in all direction

    Hi all

    I have a need to print a text entered by a user on a Dc and then
    draw a rectangle around the text

    I know the x & y coordinate that I want to put the text, so what
    I'm doing is calling to the DrawText function with the %DT_CALCRECT
    flag, so I get the rectangle, then I draw the text & the rectangle.

    The problem I have is that the user can change the escapement of the
    Text (Print the text verticaly for example). In that case, the text
    is printed out of the rectangle and I have no Idea where to draw
    the rectangle around the text.

    Any Idea how can I solve this problem. At least, how can I force the vertical
    text to be printed inside the rectangle


    Sorry, this sould be posted on pbdll forum

    [This message has been edited by Gafny Jacob (edited June 21, 2001).]

  • #2
    no idea about "normal" way to mix vertical & horizontal printing, but maybe rotatebitmap in may be useful.
    it's possible to draw horizontally on temporary hdc and then to move (with any angle) to target hdc.
    i don't think that windows works seriously faster - it should also calculate sin/cos.

    btw. if to use 32bit dib sections it's very easy to rotate per 90*x degrees using simple operations, something like ar1(x,y) = ar2(y,x)
    e-mail: [email protected]

    [this message has been edited by semen matusovski (edited june 21, 2001).]