-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCanvas.h
70 lines (50 loc) · 1.45 KB
/
Canvas.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*----------------------------------------------------------------
CCanvas Definition
----------------------------------------------------------------
Description:
仮想 DC クラス。
このクラスで作成される DC に描画し、
その上で表示 DC 上に転送(CCanvass::DrawTo)することで、
ちらつきを抑えた描画が可能になります。
Auther:
Yoshihiro Yamaguchi MPD 2-2-4
Define:
Canvas.h
Implement:
Canvas.cpp
History:
00/06/23 Initial Check-in
----------------------------------------------------------------*/
#if !defined(AFX_CANVAS_H__C51AC50A_DFEA_4FDB_BD9C_3BDEA43972FF__INCLUDED_)
#define AFX_CANVAS_H__C51AC50A_DFEA_4FDB_BD9C_3BDEA43972FF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CCanvas
{
protected:
// 表示する DC を持つ Window へのポインタ
CWnd* m_pAppWnd;
// 仮想 DC
CDC m_CanvasDC;
CBitmap m_CanvasBitmap;
// 基となるフレーム
CDC m_FrameDC;
CBitmap m_FrameBitmap;
// 仮想 DC の Size
CRect m_CanvasRect;
public:
// 仮想 DC の取得
CDC* GetCanvasDC(){ return &m_CanvasDC; }
public:
CCanvas( CWnd* pAppWnd, UINT uFrameBitmapID );
virtual ~CCanvas();
// 仮想 DC を m_FrameBitmap で初期化
virtual void ClearCanvas();
// 仮想 DC を pDC で示される DC 上に展開
virtual void DrawTo( CDC* pDC );
virtual void DrawTo( CDC* pDC, int nX, int nY );
// サイズの取得
CRect GetCanvasRect(){ return m_CanvasRect; }
};
#endif // !defined(AFX_CANVAS_H__C51AC50A_DFEA_4FDB_BD9C_3BDEA43972FF__INCLUDED_)