这篇教程C++ CreateSolidBrush函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CreateSolidBrush函数的典型用法代码示例。如果您正苦于以下问题:C++ CreateSolidBrush函数的具体用法?C++ CreateSolidBrush怎么用?C++ CreateSolidBrush使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CreateSolidBrush函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: SelectObjectvoid CardButton::Draw(HDC hdc, bool fNormal){ SIZE textsize; int x, y; //text x, y int ix, iy; //icon x, y int iconwidth = 0; RECT cliprect; if(fVisible == 0) return; if(hFont == 0) SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT)); else SelectObject(hdc, hFont); GetTextExtentPoint32(hdc, szText, lstrlen(szText), &textsize); if(hIcon) { x = rect.left + 32 + 8; } else { if(uStyle & CB_ALIGN_LEFT) { x = rect.left + iconwidth; } else if(uStyle & CB_ALIGN_RIGHT) { x = rect.left + (rect.right-rect.left-iconwidth-textsize.cx); } else //centered { x = rect.right - rect.left - iconwidth; x = (x - textsize.cx) / 2; x += rect.left + iconwidth; } } y = rect.bottom - rect.top; y = (y - textsize.cy) / 2; y += rect.top; //calc icon position.. ix = rect.left + 4; iy = rect.top + (rect.bottom-rect.top-32) / 2; //if button is pressed, then shift text if(fNormal == false && (uStyle & CB_PUSHBUTTON)) { x += 1; y += 1; ix += 1; iy += 1; } SetRect(&cliprect, x, y, x+textsize.cx, y+textsize.cy); ExcludeClipRect(hdc, x, y, x+textsize.cx, y+textsize.cy); // // Calc icon pos // if(hIcon) { ExcludeClipRect(hdc, ix, iy, ix + 32, iy + 32); } if(uStyle & CB_PUSHBUTTON) { DrawRect(hdc, &rect, fNormal); SetBkColor(hdc, MAKE_PALETTERGB(crBack)); SetTextColor(hdc, crText);//MAKE_PALETTERGB(crText)); SelectClipRgn(hdc, 0); ExtTextOut(hdc, x, y, ETO_OPAQUE, &cliprect, szText, lstrlen(szText), 0); } else { SetBkColor(hdc, MAKE_PALETTERGB(crBack)); SetTextColor(hdc, crText);//MAKE_PALETTERGB(crText)); SelectClipRgn(hdc, 0); ExtTextOut(hdc, x, y, ETO_OPAQUE, &rect, szText, lstrlen(szText), 0); } if(hIcon) { HBRUSH hbr = CreateSolidBrush(MAKE_PALETTERGB(crBack)); DrawIconEx(hdc, ix, iy, hIcon, 32, 32, 0, hbr, 0); DeleteObject(hbr); }}
开发者ID:hoangduit,项目名称:reactos,代码行数:98,
示例2: m_brushBrush::Brush(COLORREF color) : m_brush(CreateSolidBrush(color)) { assert(m_brush != 0);}
开发者ID:AndyTheFactory,项目名称:keyla,代码行数:3,
示例3: MessageBoxVOID GUIFont::DrawOnTexture( LPWSTR _pStr, DWORD _dColor, LPDIRECT3DTEXTURE9 _pTexture, INT _itexX, INT _itexY, INT _itexWidth, INT _itexHeight ){ if( _pTexture == NULL ) { MessageBox( NULL, L"DrawFontOnTexture{... _pTexture == NULL }", NULL, MB_OK ); return; } HDC hDC; HBITMAP hBit; LPVOID pBits; BITMAPINFO BitInfo; ZeroMemory( &BitInfo, sizeof( BITMAPINFO ) ); BitInfo.bmiHeader.biSize = sizeof( BITMAPINFOHEADER ); // C++ CreateStatusBar函数代码示例 C++ CreateSocket函数代码示例
|