X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b41f29c357205531670a156b67247b9345688150..e0f6b731a80035dab1c2d1224f8a2dea0c9de947:/include/wx/msw/private.h diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 7ac00c9e05..98aee97db4 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -225,7 +225,7 @@ enum wxSTD_COLOUR wxSTD_COL_BTNSHADOW, wxSTD_COL_BTNFACE, wxSTD_COL_BTNHIGHLIGHT, - wxSTD_COL_MAX, + wxSTD_COL_MAX }; struct WXDLLEXPORT wxCOLORMAP @@ -405,6 +405,27 @@ private: DECLARE_NO_COPY_CLASS(SelectInHDC) }; +// a class for temporary bitmaps +class CompatibleBitmap +{ +public: + CompatibleBitmap(HDC hdc, int w, int h) + { + m_hbmp = ::CreateCompatibleBitmap(hdc, w, h); + } + + ~CompatibleBitmap() + { + if ( m_hbmp ) + ::DeleteObject(m_hbmp); + } + + operator HBITMAP() const { return m_hbmp; } + +private: + HBITMAP m_hbmp; +}; + // when working with global pointers (which is unfortunately still necessary // sometimes, e.g. for clipboard) it is important to unlock them exactly as // many times as we lock them which just asks for using a "smart lock" class