]>
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 #if !USE_SHARED_LIBRARY
24 IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC
, wxDC
)
32 wxMemoryDC::wxMemoryDC(void)
36 m_hDC = (WXHDC) ::CreateCompatibleDC((HDC) NULL);
40 SetBrush(*wxWHITE_BRUSH);
43 // the background mode is only used for text background
44 // and is set in DrawText() to OPAQUE as required, other-
45 // wise always TRANSPARENT, RR
46 ::SetBkMode( GetHdc(), TRANSPARENT );
50 wxMemoryDC::wxMemoryDC(wxDC
*old_dc
)
54 old_dc->BeginDrawing();
56 m_hDC = (WXHDC) ::CreateCompatibleDC((HDC) old_dc->GetHDC());
61 SetBrush(*wxWHITE_BRUSH);
64 // the background mode is only used for text background
65 // and is set in DrawText() to OPAQUE as required, other-
66 // wise always TRANSPARENT, RR
67 ::SetBkMode( GetHdc(), TRANSPARENT );
71 wxMemoryDC::~wxMemoryDC(void)
75 void wxMemoryDC::SelectObject( const wxBitmap
& bitmap
)
80 void wxMemoryDC::DoGetSize( int *width
, int *height
) const
82 if (!m_selectedBitmap
.Ok())
84 *width
= 0; *height
= 0;
87 *width
= m_selectedBitmap
.GetWidth();
88 *height
= m_selectedBitmap
.GetHeight();