VC ++. NET Reading Notes (1)

xiaoxiao2021-03-13  208

Draw your text:

Use the device description of the font, text color and background color to draw text.

Call the CDC :: SetTextColor method to set the text color,

Call CDC :: SetBkcolor and CDC :: SetBkmode method Setup background color.

Want to change the color color in the DC, and make the text background transparent, you can use the following code:

PDC-> CDC :: SetTextColor (RGB (255, 0, 0));

PDC-> CDC :: setBkmode (Transparent);

The most common use of DrawText, Textout and TabbedTextout are DrawText.

DrawText is formatted in a given rectangle.

Textout is to draw a body with the currently selected font and color in the specified location.

TabbedTextOut is a grouped a text in the specified location and extends the tab to the specified location in the tab stop.

转载请注明原文地址:https://www.9cbs.com/read-129101.html

New Post(0)