CBitmap BitmapObj;
BitmapObj.LoadBitmap(IDB_BITMAP2);
HBITMAP hOldBitmap = (HBITMAP)::SelectObject(hMemDC,(HBITMAP)BitmapObj);
BitmapObj.LoadBitmap(IDB_BITMAP2);
HBITMAP hOldBitmap = (HBITMAP)::SelectObject(hMemDC,(HBITMAP)BitmapObj);
解决方案 »
- VS2008为什么卸载不了?提示:A problem has been encountered while loading the setup...
- 如何在线程中调用类的私有函数?求助各位大虾
- 文件传输怎么只有最后一块内容啊
- 有關clistctrl style的問題,
- 诚求教 怎么在VC/MFC一个应用程序下集成两种不同的数据源 并进行数据交换?
- 一个非计算机专业的大专生!请给一些建议!多谢
- studio 2010 编译出错 'ntdef.h': No such file
- 画阴影效果//AlphaArray与AlphaArray2是什么作用?
- 设置CListCtrl多行被选中的问题
- vs2008 转 vs2013代码崩溃
- CBitmap为什么转化成HBITMAP呢????
- 为啥我releasedc了还会提示重复定义呢
HBITMAP hBitmap=LoadBitmap(NULL,IDB_BITMAP2);
_In_ HDC hdc,
_In_ HGDIOBJ hgdiobj
);符合参数类型!
A handle to the object to be selected. The specified object must have been created by using one of the following functions.
Object Functions
Bitmap
CreateBitmap, CreateBitmapIndirect, CreateCompatibleBitmap, CreateDIBitmap, CreateDIBSection
Bitmaps can only be selected into memory DC's. A single bitmap cannot be selected into more than one DC at the same time.
Brush
CreateBrushIndirect, CreateDIBPatternBrush, CreateDIBPatternBrushPt, CreateHatchBrush, CreatePatternBrush, CreateSolidBrush
Font
CreateFont, CreateFontIndirect
Pen
CreatePen, CreatePenIndirect
Region
Com
=============
你上面用得没错啊!
operator HBITMAP
Returns the Windows handle attached to the CBitmap object.
也可以:
,BitmapObj.m_Object);