SDC C-Project CF Review 프로그램
LYW
2021-08-10 8ac7359b04409c2a1426f9a179c00b1c966d0146
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
 
// CCHBufferDC
class AFX_EXT_CLASS CCHBufferDC : public CDC  
{
 
private:
    CCHBufferDC() { }
    CCHBufferDC(const CCHBufferDC &src) { }
    CCHBufferDC& operator=(const CCHBufferDC &src) { return *this; }
 
protected:
    BOOL Attach(HDC hDC);
    HDC Detach();
 
private:
    CWnd*            m_pParent;                            //´ë»ó À©µµ¿ì¿¡ ´ëÇÑ Æ÷ÀÎÅÍ
    CDC*            m_pTarget;                            //´ë»ó À©µµ¿ì DC¿¡ ´ëÇÑ Æ÷ÀÎÅÍ
    PAINTSTRUCT        m_PaintStruct;
    CRect            m_RcClient, m_RcWindow;                //´ë»ó À©µµ¿ìÀÇ Å©±â Á¤º¸
 
    CDC                m_MemoryDC;                            //¹öÆÛ DC
    CBitmap            m_MemoryBmp, *m_pOldMemoryBmp;        //¹öÆÛ¸µÀ» À§ÇÑ ºñÆ®¸Ê
 
public:
    CCHBufferDC(CWnd *pParent);
    ~CCHBufferDC();
 
public:
    inline CRect ClientRect() const { return m_RcClient; }
    inline CRect WindowRect() const { return m_RcWindow; }
    inline CRect UpdateRect() const { return m_PaintStruct.rcPaint; }
 
    operator HDC() const { return m_MemoryDC.m_hDC; }       //  DC handle for API functions
};