util_mdc.h

来自「一个功能强大的串行口监视和检测程序的源代码。」· C头文件 代码 · 共 48 行

H
48
字号

// util_mdc.h

#ifndef _INC_UTIL_MDC_
#define _INC_UTIL_MDC_



class GMemDC : public CDC
{
public:
   // create a memory dc
   BOOL Create(CDC *pDC,             // device from which to create compatible dc
               const RECT& rClient,  // client rectangle of window receiving paint message 
               CBrush *pBkBrush=NULL,// brush to paint background of memory DC, default is brush of 'pDC'
               const PAINTSTRUCT *pPS=NULL); // paint struct if 'pDC' is actually a CPaintDC
   
   // copy this memory dc to a dc
   BOOL Copy(CDC *pDC,              // device to copy memory dc to
             const RECT& rDraw,     // destination rectangle of 'pDC'
             const POINT *ppt=NULL);// top-left corner of mem dc
                                   
   // release the memory dc
   BOOL Release();                   

   // return the internal paint structure
   const PAINTSTRUCT *GetPaintStruct() const;

public:
   GMemDC();
   ~GMemDC();

private:
   PAINTSTRUCT m_ps;                 // copy of paint dc paint structure

   BOOL bPaintStructInitialized;     // internal paint structure is initialized 
   CBitmap *pOldBitmap;              // bitmap to restore when dc is released
   CBitmap Bitmap;                   // bitmap to select in create

   // privatize compiler gifts
   GMemDC( const GMemDC& );
   GMemDC& operator=( const GMemDC& );
};


#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?