X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..9ed79eee4ee3f8c83a87094eef4b7c933663001b:/src/msw/dcmemory.cpp diff --git a/src/msw/dcmemory.cpp b/src/msw/dcmemory.cpp index 3d1201ce1b..36ff844b21 100644 --- a/src/msw/dcmemory.cpp +++ b/src/msw/dcmemory.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dcmemory.cpp +// Name: src/msw/dcmemory.cpp // Purpose: wxMemoryDC class // Author: Julian Smart // Modified by: @@ -24,6 +24,8 @@ #pragma hdrstop #endif +#include "wx/dcmemory.h" + #ifndef WX_PRECOMP #include "wx/utils.h" #include "wx/log.h" @@ -31,8 +33,6 @@ #include "wx/msw/private.h" -#include "wx/dcmemory.h" - // ---------------------------------------------------------------------------- // wxWin macros // ---------------------------------------------------------------------------- @@ -47,23 +47,22 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC) // wxMemoryDC // ---------------------------------------------------------------------------- -wxMemoryDC::wxMemoryDC() +wxMemoryDC::wxMemoryDC( const wxBitmap& bitmap ) { CreateCompatible(NULL); Init(); + + if ( bitmap.IsOk() ) + SelectObject(bitmap); } wxMemoryDC::wxMemoryDC(wxDC *dc) { wxCHECK_RET( dc, _T("NULL dc in wxMemoryDC ctor") ); - dc->BeginDrawing(); - CreateCompatible(dc); - dc->EndDrawing(); - Init(); } @@ -203,4 +202,3 @@ void wxMemoryDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord he wxDC::DoDrawRectangle(x, y, width, height); } } -