
2个回答
展开全部
响应这个消息功能是擦除背景
参考:
BOOL CDisplayBmpBackGroundDlg::OnEraseBkgnd(CDC *pDC) //增加擦出背景函数
{
CRect rect;
GetClientRect(&rect);
CBitmap m_pBmp;
BITMAP bm;
CDC dcMem;
m_pBmp.LoadBitmap(IDB_BITMAP1);
m_pBmp.GetBitmap(&bm);//得到位图尺寸
dcMem.CreateCompatibleDC(pDC);
CBitmap* pOldBitmap = dcMem.SelectObject(&m_pBmp);
pDC->SetStretchBltMode(COLORONCOLOR);//这个模式不设置的话会导致图片严重失真
pDC->StretchBlt(0,0,rect.Width() ,rect.Height(),
&dcMem,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
dcMem.SelectObject(pOldBitmap);
return TRUE;
}
参考:
BOOL CDisplayBmpBackGroundDlg::OnEraseBkgnd(CDC *pDC) //增加擦出背景函数
{
CRect rect;
GetClientRect(&rect);
CBitmap m_pBmp;
BITMAP bm;
CDC dcMem;
m_pBmp.LoadBitmap(IDB_BITMAP1);
m_pBmp.GetBitmap(&bm);//得到位图尺寸
dcMem.CreateCompatibleDC(pDC);
CBitmap* pOldBitmap = dcMem.SelectObject(&m_pBmp);
pDC->SetStretchBltMode(COLORONCOLOR);//这个模式不设置的话会导致图片严重失真
pDC->StretchBlt(0,0,rect.Width() ,rect.Height(),
&dcMem,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
dcMem.SelectObject(pOldBitmap);
return TRUE;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Collapse AllExpand All Code: All Code: Multiple Code: Visual Basic Code: C# Code: Visual C++ Code: J# Code: JScript
Visual Basic
C#
Visual C++
J#
JScript
MFC Library Reference
CWnd::OnEraseBkgnd
See Also Send Feedback
Updated: November 2007
The framework calls this member function when the CWnd object background needs erasing (for example, when resized).
afx_msg BOOL OnEraseBkgnd(
CDC* pDC
);
Parameters
pDC
Specifies the device-context object.
Return Value
Nonzero if it erases the background; otherwise 0.
Remarks
看不明白追问。就是当窗口需要擦除时候,系统调用这个函数。可以把ON_WM_ERASEBKGND在MSDN里查一下。就能看见这个函数了。
另:http://baike.baidu.com/view/3988473.htm
请采纳!!有问题追问!
Visual Basic
C#
Visual C++
J#
JScript
MFC Library Reference
CWnd::OnEraseBkgnd
See Also Send Feedback
Updated: November 2007
The framework calls this member function when the CWnd object background needs erasing (for example, when resized).
afx_msg BOOL OnEraseBkgnd(
CDC* pDC
);
Parameters
pDC
Specifies the device-context object.
Return Value
Nonzero if it erases the background; otherwise 0.
Remarks
看不明白追问。就是当窗口需要擦除时候,系统调用这个函数。可以把ON_WM_ERASEBKGND在MSDN里查一下。就能看见这个函数了。
另:http://baike.baidu.com/view/3988473.htm
请采纳!!有问题追问!
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询