MemoryHDC can now be used to create DCs compatible with arbitrary DCs and not just the screen

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19781 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-03-24 22:32:56 +00:00
parent a8beba7230
commit 697b08a89a

View File

@@ -362,12 +362,12 @@ private:
DECLARE_NO_COPY_CLASS(ScreenHDC) DECLARE_NO_COPY_CLASS(ScreenHDC)
}; };
// the same as ScreenHDC but for memory DCs: creates the HDC in ctor and // the same as ScreenHDC but for memory DCs: creates the HDC compatible with
// destroys it in dtor // the given one (screen by default) in ctor and destroys it in dtor
class MemoryHDC class MemoryHDC
{ {
public: public:
MemoryHDC() { m_hdc = ::CreateCompatibleDC(NULL); } MemoryHDC(HDC hdc) { m_hdc = ::CreateCompatibleDC(hdc); }
~MemoryHDC() { ::DeleteDC(m_hdc); } ~MemoryHDC() { ::DeleteDC(m_hdc); }
operator HDC() const { return m_hdc; } operator HDC() const { return m_hdc; }