]>
git.saurik.com Git - wxWidgets.git/blob - src/os2/dcmemory.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMemoryDC class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
19 #include "wx/os2/private.h"
21 #include "wx/dcmemory.h"
23 IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC
, wxDC
)
30 wxMemoryDC::wxMemoryDC(void)
34 m_hDC = (WXHDC) ::CreateCompatibleDC((HDC) NULL);
38 SetBrush(*wxWHITE_BRUSH);
41 // the background mode is only used for text background
42 // and is set in DrawText() to OPAQUE as required, other-
43 // wise always TRANSPARENT, RR
44 ::SetBkMode( GetHdc(), TRANSPARENT );
48 wxMemoryDC::wxMemoryDC(wxDC
*old_dc
)
52 old_dc->BeginDrawing();
54 m_hDC = (WXHDC) ::CreateCompatibleDC((HDC) old_dc->GetHDC());
59 SetBrush(*wxWHITE_BRUSH);
62 // the background mode is only used for text background
63 // and is set in DrawText() to OPAQUE as required, other-
64 // wise always TRANSPARENT, RR
65 ::SetBkMode( GetHdc(), TRANSPARENT );
69 wxMemoryDC::~wxMemoryDC(void)
73 void wxMemoryDC::SelectObject( const wxBitmap
& bitmap
)
78 void wxMemoryDC::DoGetSize( int *width
, int *height
) const
80 if (!m_selectedBitmap
.Ok())
82 *width
= 0; *height
= 0;
85 *width
= m_selectedBitmap
.GetWidth();
86 *height
= m_selectedBitmap
.GetHeight();