简体   繁体   中英

Drawing Text with MFC CDC

I cannot set text alignment correctly. For instance, if I do this, then bottom alignment gets lost

memDC.SetTextAlign(TA_BOTTOM); 
memDC.SetTextAlign(TA_RIGHT);
memDC.TextOutW(textRect.left, textRect.top, _T("HELLo"));

And if I do this, then right alignment gets lost.

memDC.SetTextAlign(TA_RIGHT);
memDC.SetTextAlign(TA_BOTTOM); 
memDC.TextOutW(textRect.left, textRect.top, _T("HELLo"));

There does not seem to exist a way to keep both alignments. Any suggestions to fix this?

它们是位标记:

memDC.SetTextAlign(TA_RIGHT | TA_BOTTOM);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM