如何使用双缓冲在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