怎样把位图加到对话框上??
解决方案 »
- 求助Format用法
- 通过creat动态创建静态文本框 为什么不放松WM_CTLCOLOR消息(急疯了)
- 问一个给ie添加功能的问题
- 我要写一个类似PPT里的文本输入功能的控件,没有思路
- ocx控件安装的奇怪问题
- 请教:怎样检测代码是否存在内存溢出.?
- 很在挑战性的问题,c++高手请进..........
- 小弟想得知OnLbuttonDown()时候所按下去的BUTTON的ID,如何实现???
- 请问如何设置能用滚动条浏览OLE容器里的对象!
- 今天出现了这样一个错误是怎么回事啊 ShowControlBar' : undeclared identifier
- 关于建立一个ChtmlView的问题
- 求助~
简单点的就在OnPaint中StretchBlt画位图
CBitmap bitmap;
bitmap.LoadBitmap(IDB_WSM);
HBITMAP hbitmap=(HBITMAP)::LoadImage (NULL,"wsm.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
bitmap.Attach(hbitmap);
CDC dcComp;
dcComp.CreateCompatibleDC(pDC);
dcComp.SelectObject(&bitmap);
BITMAP bminfo;
G:\ѧϰ¹¤¾ß\MSDev98\MyProjects\wsm\wsmDlg.cpp(124) : error C2065: 'pDC' : undeclared identifier
G:\ѧϰ¹¤¾ß\MSDev98\MyProjects\wsm\wsmDlg.cpp(128) : error C2227: left of '->BitBlt' must point to class/struct/union
Error executing cl.exe.wsm.exe - 2 error(s), 0 warning(s)
那地方不对呀????
bitmap.GetObject(sizeof(bminfo),&bminfo);
pDC->BitBlt(0,0,bminfo.bmWidth,bminfo.bmHeight,&dcComp,0,0,SRCCOPY);
bitmap.LoadBitmap(IDB_WSM);
HBITMAP hbitmap=(HBITMAP)::LoadImage(NULL,"wsm.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
bitmap.Attach(hbitmap);
CDC dcComp;
dcComp.CreateCompatibleDC(pDC);
dcComp.SelectObject(&bitmap);
BITMAP bminfo;
bitmap.GetObject(sizeof(bminfo),&bminfo);
pDC->BitBlt(0,0,bminfo.bmWidth,bminfo.bmHeight,&dcComp,0,0,SRCCOPY);
前面是否有CPaintDC dc(this); 用此dc
CBitmap bitmap;
bitmap.LoadBitmap(IDB_WSM);
HBITMAP hbitmap=(HBITMAP)::LoadImage(NULL,"wsm.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
bitmap.Attach(hbitmap);
CDC dcComp;
dcComp.CreateCompatibleDC(tdc);
dcComp.SelectObject(&bitmap);
BITMAP bminfo;
bitmap.GetObject(sizeof(bminfo),&bminfo);
tdc->BitBlt(0,0,bminfo.bmWidth,bminfo.bmHeight,&dcComp,0,0,SRCCOPY);可我的图怎么没有显示在对话框上
有一条警告:G:\ѧϰ¹¤¾ß\MSDev98\MyProjects\wsm\wsmDlg.cpp(165) : warning C4700: local variable 'tdc' used without having been initialized
Linking...wsm.exe - 0 error(s), 1 warning(s)
怎样初始化???
高手帮帮忙 讲详细一点啦
在属性image中选资源中的位图