MFCmfc 隐藏对话框框背景图片问题

posts - 15,&
comments - 3,&
trackbacks - 0
//放在OnPaint()里
{//设置背景图片
//CDialog::OnPaint();
GetClientRect(&rect);
*pDC=GetDC();
memdc.CreateCompatibleDC(pDC);
//从资源中载入位图
bitmap.LoadBitmap(IDB_BITMAP1);
memdc.SelectObject(bitmap);
pDC-&BitBlt(0,0,rect.Width(),rect.Height(),&memdc,0,0,SRCCOPY);
阅读(...) 评论()温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
等你忘了我是谁- 浪哥
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
&& &效果图看 相册里 那张彩票软件截图&&& &首先 resources文件夹里增加BMP格式位图资源,&& &然后在 CLotteryDlg::OnPaint()里的else之后括号里添加如下代码:&& &// CDialog::OnPaint(); &设置对话框位图时要禁止调用此对话框 &*&&// &以下设置对话框的背景位图 &
CPaintDC & dc(this); & &&& & & CR & &&& & & & GetClientRect(&rect); & &&& & &CDC & dcM & &&& & &dcMem.CreateCompatibleDC(&dc); & &&& & &CBitmap & bmpB & &&& & &bmpBackground.LoadBitmap(IDB_BITMAP1); &//对话框的背景图片 &&& & & & & & & & & & & &&& & &BITMAP & & &&& & &bmpBackground.GetBitmap(&bitmap); & &&& & &CBitmap & *pbmpOld=dcMem.SelectObject(&bmpBackground); & &&& & &dc.StretchBlt(0,0,rect.Width(),rect.Height(),&dcMem,0,0, & &&& & &bitmap.bmWidth,bitmap.bmHeight,SRCCOPY); &还有 给对话框里 添加一张小位图:在对话框里添加一个小图片:&&首先 resources文件夹里增加BMP格式位图资源, 然后在对话框里添加此图片控件,修改类型属性,选择位图ID即可添加图片了
阅读(5155)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
在LOFTER的更多文章
loftPermalink:'',
id:'fks_080064',
blogTitle:'MFC 如何实现对话框添加位图作为背景图',
blogAbstract:'&& & 实现对话框里添加位图作为背景图:&& &效果图看 相册里 那张彩票软件截图&&& &首先 resources文件夹里增加BMP格式位图资源,&& &然后在 CLotteryDlg::OnPaint()里的else之后括号里添加如下代码:&& &// CDialog::OnPaint(); &设置对话框位图时要禁止调用此对话框 &*&&// &以下设置对话框的背景位图 &\t CPaintDC & dc(this); & &&& & & CR & &&& & & & GetClientRect(&rect); & &',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:2,
publishTime:3,
permalink:'blog/static/',
commentCount:2,
mainCommentCount:1,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:true,
hostIntro:'等你忘了我是谁- 浪哥',
hmcon:'0',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list} 上传我的文档
 下载
 收藏
该文档贡献者很忙,什么也没留下。
 下载此文档
正在努力加载中...
MFC中,如何给基本对话框加上JPG格式的背景图片
下载积分:1000
内容提示:MFC中,如何给基本对话框加上JPG格式的背景图片
文档格式:DOC|
浏览次数:120|
上传日期: 17:08:48|
文档星级:
该用户还上传了这些文档
MFC中,如何给基本对话框加上JPG格式的背景图片
官方公共微信本帖子已过去太久远了,不再提供回复功能。

我要回帖

更多关于 mfc 隐藏对话框 的文章

 

随机推荐