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