VC6 CDC没有TransparentBlt函数怎么解决?

zhjwl100 2012-05-03 10:31:25
日前学一个程序,作者是用VS的用的TransparentBlt函数,在对话框窗口里绘图背景色上贴图的程序,可我想用VC6版本可是编译提示CDC没有TransparentBlt函数,找了很多方法都没有用
if ( i == 0 )
mdc.BitBlt (0, 0, WndRect.Width(), WndRect.Height(), &TempDc, 0, 0, SRCCOPY ) ;
else
mdc.TransparentBlt ( this->MyBmp[i].rect.left, \
this->MyBmp[i].rect.top, BmpInfo.bmWidth, BmpInfo.bmHeight, \
&TempDc, 0, 0, BmpInfo.bmWidth, BmpInfo.bmHeight, RGB(255,255,255) ) ;

我刚学还不懂,网上说包含Msimg32.dll库,windows.h头文件,都不管用。还有使用HDC的::TransparentBlt和StretchBlt好像和作者本意不一样而且参数不对,不知道该怎么加参数。
...全文
250 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Eleven 2012-05-03
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 的回复:]
我改成StretchBlt好像是BMP图像无法显示The bitmap has been imported correctly,howrver because it contains more than 256 colors it cannot be loaded in the bitmap editor.
但是能运行,可是无法显示位图啊。
不知怎么上传图片
[/Quote]
这个不影响
zhjwl100 2012-05-03
  • 打赏
  • 举报
回复
zhjwl100 2012-05-03
  • 打赏
  • 举报
回复
我改成StretchBlt好像是BMP图像无法显示The bitmap has been imported correctly,howrver because it contains more than 256 colors it cannot be loaded in the bitmap editor.
但是能运行,可是无法显示位图啊。
不知怎么上传图片
Eleven 2012-05-03
  • 打赏
  • 举报
回复
升级Platform SDK试试,或者使用高版本的VS,比如VS2008/VS2010
zhjwl100 2012-05-03
  • 打赏
  • 举报
回复
这个头文件也加过,没用的!
向立天 2012-05-03
  • 打赏
  • 举报
回复
头文件应该是wingdi.h
不过还是建议你用2005或2008吧
zhjwl100 2012-05-03
  • 打赏
  • 举报
回复
正确显示应该是

可我的肿么是白板啊?
向立天 2012-05-03
  • 打赏
  • 举报
回复
图片先上传到CSDN的空间

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧