dcmemory.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/msw/dcmemory.h
  3. // Purpose: wxMemoryDC class
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 01/02/97
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_DCMEMORY_H_
  11. #define _WX_DCMEMORY_H_
  12. #include "wx/dcmemory.h"
  13. #include "wx/msw/dc.h"
  14. class WXDLLIMPEXP_CORE wxMemoryDCImpl: public wxMSWDCImpl
  15. {
  16. public:
  17. wxMemoryDCImpl( wxMemoryDC *owner );
  18. wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap );
  19. wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc ); // Create compatible DC
  20. // override some base class virtuals
  21. virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
  22. virtual void DoGetSize(int* width, int* height) const;
  23. virtual void DoSelect(const wxBitmap& bitmap);
  24. virtual wxBitmap DoGetAsBitmap(const wxRect* subrect) const
  25. { return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmapOfHDC(*subrect, GetHDC() );}
  26. protected:
  27. // create DC compatible with the given one or screen if dc == NULL
  28. bool CreateCompatible(wxDC *dc);
  29. // initialize the newly created DC
  30. void Init();
  31. DECLARE_CLASS(wxMemoryDCImpl)
  32. wxDECLARE_NO_COPY_CLASS(wxMemoryDCImpl);
  33. };
  34. #endif
  35. // _WX_DCMEMORY_H_