询问者
MFC中bitblt拷贝的问题

问题
-
我需要在mfc中拷贝原图再在相同的位置把图片粘贴回来,我自己写的小程序也能够正确做到,但是不知道为啥在我修改别人的程序时粘贴时就出了问题。
无操作原图:
当我进行简单的自身拷贝自身时:
pDC->BitBlt(LpRect.left +100, LpRect.top, 200, 1688, pDC, LpRect.left, LpRect.top, SRCCOPY);
图片:
但是当我复制后再粘贴时:
CDC curveDC;
CBitmap bitmap,*pOldBitmap;
curveDC.CreateCompatibleDC(rectinfo.testDC);
bitmap.CreateCompatibleBitmap(rectinfo.testDC,200,1688);
pOldBitmap = curveDC.SelectObject(&bitmap);curveDC.BitBlt(0, 0, 200, 1688, pDC, LpRect.left, LpRect.top, SRCCOPY); pDC->BitBlt(LpRect.left +100, LpRect.top, 200, 1688, &curveDC, 0,0, SRCCOPY);
- 已移动 Caillen 2016年4月21日 5:19
全部回复
-
Hi lanxinwoaini,
你的问题好像是关于MFC的,我会把你的帖子移到C++中文论坛以获取更好的支持。
Regards,,
Moonlight
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. -
程序在http://share.weiyun.com/53c6af81c21f26b95d21027b0eda2c22
安装步骤为
解压后最好放在e盘根目录下
1 解压后运行Graphic.sln编译通过后,以管理员身份运行cmd,
根据具体目录注册ocx,例如 regsvr32 E:\GraphicOcx\Graphic\Debug\Graphic.ocx
2 运行test目录下的WindowsFormsApplication1.sln并编译成功
2 在Graphic的vs中,项目->属性->配置属性->调试->命令
导入test目录下的exe路径,例如E:\GraphicOcx\Test\WindowsFormsApplication1\
WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
3 如果界面出现则表示运行成功。如果不成功提示模板错误等
则修改GraphicOcx\Graphic\Debug下的Graphic.ini中DataPath路径和TemplateName路径为自己的实际路径我提问的代码在Curve.cpp的1100行左右
-
不好意思,我这边认为你的代码是病毒,下载不了,你可以把代码放在微软的onedrive上面吗?
https://onedrive.live.com/?id=root&cid=D3BD96EB79780818
- 已编辑 Hart WangModerator 2016年4月26日 9:34