Skip to content

Commit

Permalink
revert back GetTextSize which was deleted by commit 09d6e9e
Browse files Browse the repository at this point in the history
  • Loading branch information
ngugc committed May 9, 2018
1 parent 0170cc5 commit 527cb96
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions DuiLib/Core/UIRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2478,6 +2478,18 @@ namespace DuiLib {
return hBitmap;
}

SIZE CRenderEngine::GetTextSize( HDC hDC, CPaintManagerUI* pManager , LPCTSTR pstrText, int iFont, UINT uStyle )
{
SIZE size = {0,0};
ASSERT(::GetObjectType(hDC)==OBJ_DC || ::GetObjectType(hDC)==OBJ_MEMDC);
if( pstrText == NULL || pManager == NULL ) return size;
::SetBkMode(hDC, TRANSPARENT);
HFONT hOldFont = (HFONT)::SelectObject(hDC, pManager->GetFont(iFont));
GetTextExtentPoint32(hDC, pstrText, _tcslen(pstrText) , &size);
::SelectObject(hDC, hOldFont);
return size;
}

void CRenderEngine::CheckAlphaColor(DWORD& dwColor)
{
//RestoreAlphaColor认为0x00000000是真正的透明,其它都是GDI绘制导致的
Expand Down

0 comments on commit 527cb96

Please sign in to comment.