Click to Rate and Give Feedback
MSDN
MSDN Library
DrawText

This content has moved to another location. See DrawText for the latest version.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
DrawText and TextOut are sensitive to memory aligment when drawing to a DIBSection      SteelBytes   |   Edit   |   Show History

DrawTextW on 2000 and XP will not render to a DIBSection if the string is not WCHAR aligned in memory. But it does work in Vista.
TextOutW will not render to a DIBSection when the string is non WCHAR aligned on any of 2000, XP or Vista.
Both DrawTextW and TextOutW work find when drawing to either a screen DC or a printer DC on all three Windows flavours.

see http://louis.steelbytes.com/DrawTextBug.html for more info

Tags What's this?: Add a tag
Flag as ContentBug
Get the Text's Bounding RECT      Patillo   |   Edit   |   Show History
Using the DT_CALCRECT flag will result in the text's bounding rect being stored in the lprect parameter of DrawText. The actual location of the left, top, right and bottom are stored. The function does not store the actual dimensions.

Note that using DT_CALCRECT will not draw the text, so a subsequent call to DrawText is required.


Tags What's this?: Add a tag
Flag as ContentBug
DT_MODIFYSTRING on Vista      Vlad VIssoultchev   |   Edit   |   Show History
It seems that on Vista DT_MODIFYSTRING no longer modifies lpchText past the end of the string (zero terminator) so previous documentation about modifing +4 characters is no longer valid.

The result is that the appended ellipses at the end of the string might be less than 3 although 3 ellipses get painted on the DC.

Tip: Combine DT_MODIFYSTRING and DT_CALCRECT to prevent painting but get the string modified.

cheers,
</wqw>
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker