When you finish with the CBitmap object created with the CreateCompatibleBitmap function, first select the bitmap out of the device context, then delete the CBitmap object.是不是说 CBitmap 要执行DeleteObject()这个呀.我看了看他的稀构什么也没做.
_AFXWIN_INLINE CBitmap::~CBitmap()
{ }_AFXWIN_INLINE CFont::~CFont()
{ }
_AFXWIN_INLINE CBrush::~CBrush()
{ }
这些是不是都要自己手动删除呀.
其他的用删除吗.
_AFXWIN_INLINE CBitmap::~CBitmap()
{ }_AFXWIN_INLINE CFont::~CFont()
{ }
_AFXWIN_INLINE CBrush::~CBrush()
{ }
这些是不是都要自己手动删除呀.
其他的用删除吗.
析构函数自动执行他的意思应该是在你使用完 CBitmap 之后,要将 bitmap 从 DC 中释放出来: CDC dc;
CBitmap bmp;
CBitmap *pOldBmp = NULL; bmp.CreateCompatibleBitmap(...); pOldBmp = dc.SelectObject( &bmp );
...
...--> dc.SelectObject( pOldBmp );