给窗体绘制背景图片 vc
来源:百度文库 编辑:神马文学网 时间:2024/10/03 03:33:58
zyyoung @ 2007-05-30 12:21 | C++
给窗体绘制背景图片view plaincopy to clipboardprint?
//给窗体绘制背景图片(1)图片控件(2)GDI绘制
//方法(2)
void C*Dlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// load IDB_BITMAP1 from our resources
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
// Get the size of the bitmap
BITMAP bmpInfo;
bmp.GetBitmap(&bmpInfo);
// Create an in-memory DC compatible with the
// display DC we're using to paint
CDC dcMemory;
dcMemory.CreateCompatibleDC(&dc);
// Select the bitmap into the in-memory DC
CBitmap *pOldBmp=dcMemory.SelectObject(&bmp);
if(!m_bStretch.GetCheck())
{
// Copy the bits from the in-memory DC into the on-
// screen DC to actually do the painting
dc.BitBlt(0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, &dcMemory, 0, 0, SRCCOPY);
}
else
{
//Get Client area
CRect wndRt;
this->GetClientRect(&wndRt);
// Stretch and copy the bits from the in-memory DC into the on-
// screen DC to actually do the painting
dc.StretchBlt(0, 0, wndRt.Width(), wndRt.Height (),
&dcMemory, 0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, SRCCOPY);
}
dcMemory.SelectObject(pOldBmp);
}
给窗体绘制背景图片view plaincopy to clipboardprint?
//给窗体绘制背景图片(1)图片控件(2)GDI绘制
//方法(2)
void C*Dlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// load IDB_BITMAP1 from our resources
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
// Get the size of the bitmap
BITMAP bmpInfo;
bmp.GetBitmap(&bmpInfo);
// Create an in-memory DC compatible with the
// display DC we're using to paint
CDC dcMemory;
dcMemory.CreateCompatibleDC(&dc);
// Select the bitmap into the in-memory DC
CBitmap *pOldBmp=dcMemory.SelectObject(&bmp);
if(!m_bStretch.GetCheck())
{
// Copy the bits from the in-memory DC into the on-
// screen DC to actually do the painting
dc.BitBlt(0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, &dcMemory, 0, 0, SRCCOPY);
}
else
{
//Get Client area
CRect wndRt;
this->GetClientRect(&wndRt);
// Stretch and copy the bits from the in-memory DC into the on-
// screen DC to actually do the painting
dc.StretchBlt(0, 0, wndRt.Width(), wndRt.Height (),
&dcMemory, 0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, SRCCOPY);
}
dcMemory.SelectObject(pOldBmp);
}
给窗体绘制背景图片 vc
VC窗体设计
绘制窗体时防止闪烁
一个简单的VC直线绘制程序
给Button添加背景图片jhdgjj
给Button添加背景图片agdg'
背景图片
背景图片
背景图片
背景图片-
VC知识库文章 - 在MFC中用正则表达式对窗体进行有效性验证
如何给个人网页设置背景图片
XP下给文件夹添加背景图片
asp.net 给button 控件 换个背景图片
用户窗体
用户窗体
给正准备学习VC++朋友的建议 - 编程学习经验 - ★ VC 驿站 ★ - Powere...
引用 引用 给网页加背景图片的代码,电脑技术|网络技术|网页设计|程序设计
引用 如何给个人网页设置背景图片 - xiaoshudeqiqiu的日志 - 网易博客
引用 如何给个人网页设置背景图片 - xiaoshudeqiqiu的日志 - 网易博客
淡雅背景图片
淡雅背景图片..
博客背景图片
背景图片-----月亮