Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cWndDCBit.h
Go to the documentation of this file.
1 //
5 //
6 
7 #ifndef _INC_cWndDCBit_H
8 #define _INC_cWndDCBit_H
9 #ifndef NO_PRAGMA_ONCE
10 #pragma once
11 #endif
12 
13 #include "cWndBitmap.h"
14 #include "cWndDC.h"
15 
16 #ifdef _WIN32
17 #include "../Image/cSurfaceBase.h"
18 
19 namespace GrayLib
20 {
21  UNITTEST2_PREDEF(cWndDCBit);
22 
23  class GRAYLIB_LINK cWndDCBit : public cWndDCOwn
24  {
28  public:
29  cWndBitmap m_Bitmap;
30 
31  protected:
32  void DeleteDCBit();
33 
34  public:
35  cWndDCBit();
36  ~cWndDCBit();
37 
38  HRESULT CreateSurface(HDC hDC, PIXELS_t cx, PIXELS_t cy);
39  bool DrawToDC( HDC hDCDst ) const;
40  bool StretchToDC(HDC hDCDst, PIXELS_t iDstCX, PIXELS_t iDstCY) const;
41  bool CopyFromDC( HDC hDCSrc );
42  bool StretchFromDC(HDC hDCSrc, PIXELS_t iSrcCX, PIXELS_t iSrcCY);
43 
44  UNITTEST2_PREDEF(cWndDCBit);
45  };
46 
47  class GRAYLIB_LINK cWndDCSurf : public cWndDCBit
48  {
55 
56  typedef cWndDCBit SUPER_t;
57 
58  public:
59  cSurfaceBase m_Surf;
60  public:
61  cWndDCSurf();
62  ~cWndDCSurf();
63 
64  void DeleteDCBit();
65 
66  HRESULT CreateSurface(HDC hDCCompat, PIXELS_t cx, PIXELS_t cy, SURF_FORM_TYPE ePixelFormat = SURF_FORM_UNKNOWN);
67  void FillSurface( COLORREF colorBack );
68 
69  int DrawSurfToDC( HDC hDCDest, const RECT* pRectPaint );
70  };
71 };
72 #endif // _WIN32
73 #endif // _INC_cWndDCBit_H
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
UINT32 COLORREF
ABGR (high to low bits)
Definition: cVariantData.h:21
Definition: cMesh.h:22
UNITTEST2_PREDEF(cQuadtree)
SURF_FORM_TYPE
Definition: cSurfaceInfo.h:24
@ SURF_FORM_UNKNOWN
AKA D3DFMT_UNKNOWN.
Definition: cSurfaceInfo.h:32
int PIXELS_t
Count of pixels in a dimension of some image/surface.
Definition: cSurfaceInfo.h:20