GetTextExtent
Computes the width and height of a line of text on the attribute device context using the current font to determine the dimensions.
SIZE GetTextExtent( const string & str )
The dimensions of the string (in logical units) in a SIZE structure.
EX1
void DeviceContext_GetTextExtent_ex2() { WorksheetPage testWks = Project.WorksheetPages(0); Window wnd = testWks.GetWindow(); DeviceContext dc = wnd.GetDC(); SIZE sz[10]; string strCheck = "ABC"; sz[2] = dc.GetTextExtent(strCheck); out_int("x_width = ", sz[2].cx); out_int("y_width = ", sz[2].cy); }
origin.h