Rick Roen
2003-07-18 15:12:05 UTC
I'm trying to use DrawTextEx like this:
SetTextAlign( Printer.canvas.handle, TA_CENTER;
...
.some other printing code using TextOut
.
DrawTextEx( Printer.Canvas.handle, PChar( SomeText ), -1,
aRect, DT_SINGLELINE OR DT_CENTER OR DT_END_ELLIPSIS OR DT_TOP, nil );
Then the DrawTextEx does not print in the correct position, i.e. Centered.
It appears left aligned.
If I change to
SetTextAlign( Printer.canvas.handle, TA_LEFT );
before calling DrawTextEx then everything is printed as expected.
Any idea why? I would have expected that since the text align is set within
the call to DrawTextEx that any other alignment setting would be ignored.
TIA
Rick
SetTextAlign( Printer.canvas.handle, TA_CENTER;
...
.some other printing code using TextOut
.
DrawTextEx( Printer.Canvas.handle, PChar( SomeText ), -1,
aRect, DT_SINGLELINE OR DT_CENTER OR DT_END_ELLIPSIS OR DT_TOP, nil );
Then the DrawTextEx does not print in the correct position, i.e. Centered.
It appears left aligned.
If I change to
SetTextAlign( Printer.canvas.handle, TA_LEFT );
before calling DrawTextEx then everything is printed as expected.
Any idea why? I would have expected that since the text align is set within
the call to DrawTextEx that any other alignment setting would be ignored.
TIA
Rick