-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBufferDC.h
More file actions
34 lines (26 loc) · 880 Bytes
/
Copy pathBufferDC.h
File metadata and controls
34 lines (26 loc) · 880 Bytes
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
#pragma once
class CBufferDC : public CDC
{
private:
CBufferDC() { }
CBufferDC(const CBufferDC &src) { }
CBufferDC& operator=(const CBufferDC &src) { }
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:
CBufferDC(CWnd *pParent);
~CBufferDC();
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
};