使用updatelayeredWindow出现问题 ++++

asight 2011-08-08 01:58:25
我写个函数更新窗体 虽然执行成功但是不能显示 求解


HDC hDC = ::GetDC(m_hWnd);
RECT r;
GetClientRect(&r);
HBITMAP hBmp = ::CreateCompatibleBitmap(hDC,r.right,r.bottom);
HDC hMemDC = ::CreateCompatibleDC(hDC);
::SelectObject(hMemDC,hBmp);

Graphics g(hMemDC);
g.SetSmoothingMode(SmoothingModeHighQuality);
g.FillRectangle(&SolidBrush(Color::Red), 0, 0, r.right, r.bottom); //background
if (boundColor.GetAlpha() != 0) {
g.DrawRectangle(&Pen(boundColor),0,0,r.right,r.bottom);
}
g.FillPath(textBrush,textPath);

BLENDFUNCTION blend = { AC_SRC_OVER, 0, m_transparency, AC_SRC_ALPHA };
POINT p = {0,0};
if (::UpdateLayeredWindow(m_hWnd,hDC,NULL,NULL,hMemDC,&p,0,&blend,ULW_ALPHA|ULW_COLORKEY) == TRUE) AfxMessageBox(L"update!!");
else
{
DWORD e = GetLastError();
ASSERT("%d",e);
}
::DeleteObject(hBmp);
::DeleteDC(hMemDC);
::ReleaseDC(m_hWnd,hDC);
...全文
119 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
向立天 2011-08-19
  • 打赏
  • 举报
回复
您好
我是本版版主
此帖已多日无人关注
请您及时结帖
如您认为问题没有解决可按无满意结帖处理
另外本版设置了疑难问题汇总帖
并已在版面置顶
相关规定其帖子中有说明
您可以根据规定提交您帖子的链接
如您目前不想结帖只需回帖说明
我们会删除此结帖通知

见此回复三日内无回应
我们将强制结帖
相关规定详见界面界面版关于版主结帖工作的具体办法
asight 2011-08-08
  • 打赏
  • 举报
回复
pptDst [in, optional]
Type: POINT*

A pointer to a structure that specifies the new screen position of the layered window. If the current position is not changing, pptDst can be NULL.
psize [in, optional]
Type: SIZE*

A pointer to a structure that specifies the new size of the layered window. If the size of the window is not changing, psize can be NULL. If hdcSrc is NULL, psize must be NULL.

这个误导我了 不为NULL执行成功 结贴
asight 2011-08-08
  • 打赏
  • 举报
回复
帖子沉了 我顶起来
asight 2011-08-08
  • 打赏
  • 举报
回复
没人回答坚持顶上去 up up up

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧