本文整理汇总了C++中CDC::DrawIconEx方法的典型用法代码示例。如果您正苦于以下问题:C++ CDC::DrawIconEx方法的具体用法?C++ CDC::DrawIconEx怎么用?C++ CDC::DrawIconEx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDC
的用法示例。
在下文中一共展示了CDC::DrawIconEx方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _DrawSoftItem
void CTrashSkipCtrl::_DrawSoftItem(CDC& dc, CRect& rcDraw, int nItemIndex)
{
TRASH_SKIP_ITEM item = m_vecItems[nItemIndex];
HICON hIcon = NULL;
CRect rcCloseBtn(rcDraw);
int xSrc;
_DrawItemBackgnd(dc, rcDraw, nItemIndex);
Gdiplus::Graphics graphics(dc);
rcCloseBtn.left = rcDraw.right - 25;
rcCloseBtn.bottom = rcDraw.top + 25;
if (m_nHoverIndex == nItemIndex && m_nSelectIndex == -1)
{
xSrc = 25;
}
else if (m_nSelectIndex == nItemIndex)
{
xSrc = 50;
}
else
{
xSrc = 0;
}
graphics.DrawImage(m_imgSoftOff, rcCloseBtn.left, rcCloseBtn.top, xSrc, 0, 25, 25, Gdiplus::UnitPixel);
::CopyRect(m_vecItems[nItemIndex].rcItem, rcCloseBtn);
_GetItemIcon(item.strIconPath, hIcon);
CRect rcIcon(rcDraw);
rcIcon.left += (DEF_ITEM_WIDTH - 6 - 32) / 2;
rcIcon.top += 24;
if (!hIcon)
{
KAppRes& res = KAppRes::Instance();
if (item.nItemID == BROWER_IE)
{
hIcon = m_iconIE;
}
else
{
hIcon = m_iconUnknow;
}
dc.DrawIcon(rcIcon.left, rcIcon.top, hIcon);
}
else
{
dc.DrawIconEx(rcIcon.left, rcIcon.top, hIcon, 32, 32);
}
_DrawItemText(dc, rcDraw, item.strName);
if (hIcon && (hIcon != m_iconIE && hIcon != m_iconUnknow))
{
DestroyIcon(hIcon);
}
}