MCPcopy Create free account
hub / github.com/cinience/RedisStudio / GetTextSize

Method GetTextSize

DuiLib/Core/UIRender.cpp:1940–1950  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1938}
1939
1940SIZE CRenderEngine::GetTextSize( HDC hDC, CPaintManagerUI* pManager , LPCTSTR pstrText, int iFont, UINT uStyle )
1941{
1942 SIZE size = {0,0};
1943 ASSERT(::GetObjectType(hDC)==OBJ_DC || ::GetObjectType(hDC)==OBJ_MEMDC);
1944 if( pstrText == NULL || pManager == NULL ) return size;
1945 ::SetBkMode(hDC, TRANSPARENT);
1946 HFONT hOldFont = (HFONT)::SelectObject(hDC, pManager->GetFont(iFont));
1947 GetTextExtentPoint32(hDC, pstrText, _tcslen(pstrText) , &size);
1948 ::SelectObject(hDC, hOldFont);
1949 return size;
1950}
1951
1952} // namespace DuiLib

Callers

nothing calls this directly

Calls 1

GetFontMethod · 0.45

Tested by

no test coverage detected