0
我試圖用方法DrawState
繪製一個禁用的圖標。我現在的問題是,此方法忽略寬度(參數BUTTONWIDTH
)和高度(參數BUTTONHEIGHT
)。特定寬度和高度的DrawState
是否有其他方法可用或需要更改某些參數?
void CPgFPButton::DrawButtonIcon(LPDRAWITEMSTRUCT lpdis, HICON hicon)
{
RECT rect = lpdis->rcItem;
rect.left = 3;
rect.top = 3;
if (!m_Enabled)
DrawState(lpdis->hDC,NULL, NULL, (LPARAM)hicon, (WPARAM)NULL,
rect.left, rect.top, BUTTONWIDTH, BUTTONHEIGHT,
DST_COMPLEX | DST_ICON|DSS_DISABLED);
else
DrawIconEx(lpdis->hDC,
rect.left,rect.top,hicon,
BUTTONWIDTH - 3 * 2,
BUTTONHEIGHT - 3 * 2,0,NULL,DI_NORMAL);
}