首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

怎么使用双缓冲在Button下画png

2013-02-24 
如何使用双缓冲在Button上画png?如题以下是加载png代码void CMyColorButton::DrawItem(LPDRAWITEMSTRUCT l

如何使用双缓冲在Button上画png?
如题

以下是加载png代码

void CMyColorButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)//CMyColorButton派生至CButton
{
CRect rc;
 GetClientRect(&rc);
 CDC dc;
 using namespace Gdiplus;//应用 GDI+前必须的设置
 Graphics graph(GetDC()->m_hDC);
 Image image(_T("C:\\testImg.png"));
 graph.DrawImage(&image,0,0,rc.right-rc.left,rc.bottom-rc.top);
}

点击按钮时候,明显看到按钮图标闪烁,查了很多资料说是双缓冲可以解决,但资源都是用bitmap的,请求大牛帮帮忙,给个实例。。。万分感激 button image gdi+ graph
[解决办法]
http://www.codeproject.com/Articles/26887/A-user-draw-button-that-supports-PNG-files-with-tr

热点排行