gpt4 book ai didi

c++ - 具有特定宽度和高度的 DrawState

转载 作者:行者123 更新时间:2023-11-28 06:01:11 26 4
gpt4 key购买 nike

我正在尝试使用方法 DrawState 绘制一个禁用的图标。我现在的问题是此方法忽略了宽度(参数 BUTTONWIDTH)和高度(参数 BUTTONHEIGHT)。

是否有其他方法可用或我需要更改一些参数?

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);
}

最佳答案

来自 MSDN :

The image type and state. This parameter can be one of the following type values.
DST_COMPLEX
DST_ICON

This parameter can also be one of the following state values.
DSS_DISABLED

您正在传递 DST_COMPLEX | DST_ICON|DSS_DISABLED。看起来您应该决定是使用 DST_COMPLEX 还是 DST_ICON 而不是同时使用两者。提醒:宽度和高度仅用于DST_COMPLEX

关于c++ - 具有特定宽度和高度的 DrawState,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33261381/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com