Visual Studio C++ MFC 기반의 UI 실습을 위해, 구글에서 그림을 그릴 대상을 찾아보았다.
멋진 2층 단독주택이 보여서 MFC 기반으로 집을 그려보기로 하였다.
MFC 클래스 중 CClientDC 클래스가 있다.
해당 클래스의 객체에서 펜(Pen)과 브러시(Brush)를 생성하고 집을 그려보았다.
원본 이미지에서 일일히 그림을 그릴 좌표(x, y)를 찝어내야 하는 노가다가 필요하다.
그래서 주변에서 이미지 클릭 시 좌표(x, y)를 축출해내는 Visual Basic 프로그램을 인수해 실시간 좌표를 따서 진행했다.
(ProjectNameView.cpp 예제 참고)
// ProjectName.h
#if !defined(AFX_PROJECTNAME_H__D4761A51_08E4_4C20_991C_96FD9393D9BB__INCLUDED_)
#define AFX_PROJECTNAME_H__D4761A51_08E4_4C20_991C_96FD9393D9BB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
class CProjectNameApp : public CWinApp
{
public:
CProjectNameApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CProjectNameApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CProjectNameApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PROJECTNAME_H__D4761A51_08E4_4C20_991C_96FD9393D9BB__INCLUDED_)
// ProjectName.cpp
#include "stdafx.h"
#include "ProjectName.h"
#include "MainFrm.h"
#include "ProjectNameDoc.h"
#include "ProjectNameView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
BEGIN_MESSAGE_MAP(CProjectNameApp, CWinApp)
//{{AFX_MSG_MAP(CProjectNameApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
CProjectNameApp::CProjectNameApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CProjectNameApp object
CProjectNameApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CProjectNameApp initialization
BOOL CProjectNameApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CProjectNameDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CProjectNameView));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CProjectNameApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
// ProjectNameDoc.cpp
#include "stdafx.h"
#include "ProjectName.h"
#include "ProjectNameDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CProjectNameDoc, CDocument)
BEGIN_MESSAGE_MAP(CProjectNameDoc, CDocument)
//{{AFX_MSG_MAP(CProjectNameDoc)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
CProjectNameDoc::CProjectNameDoc()
{
// TODO: add one-time construction code here
}
CProjectNameDoc::~CProjectNameDoc()
{
}
BOOL CProjectNameDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CProjectNameDoc serialization
void CProjectNameDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CProjectNameDoc diagnostics
#ifdef _DEBUG
void CProjectNameDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CProjectNameDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
// ProjectNameView.cpp
#include "stdafx.h"
#include "ProjectName.h"
#include "ProjectNameDoc.h"
#include "ProjectNameView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CProjectNameView, CView)
BEGIN_MESSAGE_MAP(CProjectNameView, CView)
//{{AFX_MSG_MAP(CProjectNameView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProjectNameView construction/destruction
CProjectNameView::CProjectNameView()
{
// TODO: add construction code here
}
CProjectNameView::~CProjectNameView()
{
}
BOOL CProjectNameView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CProjectNameView drawing
void CProjectNameView::OnDraw(CDC* pDC)
{
CProjectNameDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
CClientDC dc(this);
// 하늘
CPen pHa;
CBrush bHa;
pHa.CreatePen(PS_SOLID,1,RGB(254,254,254));
bHa.CreateSolidBrush(RGB(254,254,254));
dc.SelectObject(&pHa), dc.SelectObject(&bHa);
POINT arr1[] = {{0,0},{1500,0},{1500,405},{894,410},{47,332},{0,333}};
dc.Polygon(arr1,6);
//
CPen pHa1;
CBrush bHa1;
pHa1.CreatePen(PS_SOLID,1,RGB(186,221,254));
bHa1.CreateSolidBrush(RGB(186,221,254));
dc.SelectObject(&pHa1), dc.SelectObject(&bHa1);
POINT arr2[] = {{623,4},{647,20},{647,36},{677,40},{691,51},{709,50},{704,58},{676,60},{693,72},{715,77},
{724,98},{715,108},{778,113},{820,108},{874,106},{877,80},{883,66},{864,71},{842,69},{825,77},
{778,79},{756,73},{735,75},{734,65},{742,61},{750,52},{762,50},{770,44},{755,32},{790,33},
{818,7},{844,5},{857,9},{855,30},{853,42},{884,44},{906,36},{926,19},{923,6},{897,4},
{895,21},{885,32},{864,36},{878,19},{892,6}};
dc.Polygon(arr2,45);
//
CPen pHa2;
CBrush bHa2;
pHa2.CreatePen(PS_SOLID,1,RGB(227,239,251));
bHa2.CreateSolidBrush(RGB(227,239,251));
dc.SelectObject(&pHa2), dc.SelectObject(&bHa2);
POINT arr3[] = {{258,7},{275,26},{303,36},{329,42},{331,49},{363,54},{370,60},{395,60},{404,75},{444,77},
{443,63},{451,55},{449,48},{432,50},{428,36},{427,25},{419,4}};
dc.Polygon(arr3,17);
//
CPen pHa3;
CBrush bHa3;
pHa3.CreatePen(PS_SOLID,1,RGB(232,240,250));
bHa3.CreateSolidBrush(RGB(232,240,250));
dc.SelectObject(&pHa3), dc.SelectObject(&bHa3);
POINT array2[] = {{126,103},{113,101},{99,87},{68,97},{50,98},{21,82},{9,92},{19,118},{106,126}};
dc.Polygon(array2,9);
// 땅
CPen pDD;
CBrush bDD;
pDD.CreatePen(PS_SOLID,1,RGB(124,145,72));
bDD.CreateSolidBrush(RGB(124,145,72));
dc.SelectObject(&pDD), dc.SelectObject(&bDD);
POINT arr4[] = {{1500,405},{894,410},{45,332},{0,333},{0,1500},{1500,1500}};
dc.Polygon(arr4,6);
// 집틀
CPen pJT;
CBrush bJT;
pJT.CreatePen(PS_SOLID,1,RGB(188,199,205));
bJT.CreateSolidBrush(RGB(188,199,205));
dc.SelectObject(&pJT), dc.SelectObject(&bJT);
POINT arr5[] = {{919,380},{712,155},{497,380},{553,380},{554,370},{515,370},{712,170},{900,370},{857,370},{857,380},
{894,380},{917,380}};
dc.Polygon(arr5,12);
// 왼쪽 사다리꼴
CPen pJT1;
CBrush bJT1;
pJT1.CreatePen(PS_SOLID,1,RGB(72,63,65));
bJT1.CreateSolidBrush(RGB(72,63,65));
dc.SelectObject(&pJT1), dc.SelectObject(&bJT1);
POINT arr6[] = {{538,348},{546,348},{554,370},{515,370}};
dc.Polygon(arr6,4);
// 오른쪽 사다리꼴
CPen pJT2;
CBrush bJT2;
pJT2.CreatePen(PS_SOLID,1,RGB(72,63,65));
bJT2.CreateSolidBrush(RGB(72,63,65));
dc.SelectObject(&pJT2), dc.SelectObject(&bJT2);
POINT arr7[] = {{865,354},{885,354},{900,370},{857,370}};
dc.Polygon(arr7,4);
// 두번째 집틀
CPen pJT3;
CBrush bJT3;
pJT3.CreatePen(PS_SOLID,1,RGB(172,175,178));
bJT3.CreateSolidBrush(RGB(172,175,178));
dc.SelectObject(&pJT3), dc.SelectObject(&bJT3);
POINT arr8[] = {{538,348},{546,348},{708,188},{865,354},{885,354},{710,168},{538,348}};
dc.Polygon(arr8,7);
// 집 몸체
CPen pJT4;
CBrush bJT4;
pJT4.CreatePen(PS_SOLID,1,RGB(160,160,160));
bJT4.CreateSolidBrush(RGB(160,160,160));
dc.SelectObject(&pJT4), dc.SelectObject(&bJT4);
POINT arr9[] = {{515,380},{554,380},{554,370},{546,348},{708,188},{865,354},{856,370},{856,380},{894,380},{894,610},
{515,610},{515,380}};
dc.Polygon(arr9,12);
// 오른쪽 집틀 끝. 왼쪽 집틀 시작
CPen pJT5;
CBrush bJT5;
pJT5.CreatePen(PS_SOLID,1,RGB(188,199,205));
bJT5.CreateSolidBrush(RGB(188,199,205));
dc.SelectObject(&pJT5), dc.SelectObject(&bJT5);
POINT arr10[] = {{42,234},{81,234},{81,244},{24,244},{144,121},{252,244},{208,244},{208,234},{235,234},{143,133},{42,234}};
dc.Polygon(arr10,11);
// 왼쪽 사다리꼴
CPen pJT6;
CBrush bJT6;
pJT6.CreatePen(PS_SOLID,1,RGB(72,63,65));
bJT6.CreateSolidBrush(RGB(72,63,65));
dc.SelectObject(&pJT6), dc.SelectObject(&bJT6);
POINT arr11[] = {{42,234},{81,234},{73,222},{55,222}};
dc.Polygon(arr11,4);
// 오른쪽 사다리꼴
CPen pJT7;
CBrush bJT7;
pJT7.CreatePen(PS_SOLID,1,RGB(72,63,65));
bJT7.CreateSolidBrush(RGB(72,63,65));
dc.SelectObject(&pJT7), dc.SelectObject(&bJT7);
POINT arr12[] = {{208,234},{235,234},{230,229},{214,229}};
dc.Polygon(arr12,4);
// 두번째 집틀
CPen pJT8;
CBrush bJT8;
pJT8.CreatePen(PS_SOLID,1,RGB(172,175,178));
bJT8.CreateSolidBrush(RGB(172,175,178));
dc.SelectObject(&pJT8), dc.SelectObject(&bJT8);
POINT arr13[] = {{55,222},{73,222},{144,148},{214,229},{230,229},{143,133}};
dc.Polygon(arr13,6);
// 집 몸체
CPen pJT9;
CBrush bJT9;
pJT9.CreatePen(PS_SOLID,1,RGB(160,160,160));
bJT9.CreateSolidBrush(RGB(160,160,160));
dc.SelectObject(&pJT9), dc.SelectObject(&bJT9);
POINT arr14[] = {{49,244},{81,244},{81,234},{73,222},{144,148},{214,229},{208,234},{208,244},{244,244},{244,599},{49,599}};
dc.Polygon(arr14,11);
// 오른쪽 지붕
CPen pRJ;
CBrush bRJ;
pRJ.CreatePen(PS_SOLID,1,RGB(95,77,104));
bRJ.CreateSolidBrush(RGB(95,77,104));
dc.SelectObject(&pRJ), dc.SelectObject(&bRJ);
POINT arr15[] = {{778,124},{511,124},{511,363},{712,155},{904,363}};
dc.Polygon(arr15,5);
// 왼쪽 지붕
CPen pLJ;
CBrush bLJ;
pLJ.CreatePen(PS_SOLID,1,RGB(95,77,104));
bLJ.CreateSolidBrush(RGB(95,77,104));
dc.SelectObject(&pLJ), dc.SelectObject(&bLJ);
POINT arr16[] = {{53,212},{136,93},{536,93},{548,244},{252,244},{144,121}};
dc.Polygon(arr16,6);
// 오른쪽지붕그림자
CPen pRJS;
CBrush bRJS;
pRJS.CreatePen(PS_SOLID,1,RGB(72,63,65));
bRJS.CreateSolidBrush(RGB(72,63,65));
dc.SelectObject(&pRJS), dc.SelectObject(&bRJS);
POINT arr17[] = {{538,124},{548,244},{511,274},{511,301},{564,302},{606,261},{586,138}};
dc.Polygon(arr17,7);
// 왼쪽지붕그림자
CPen pLJS;
CBrush bLJS;
pLJS.CreatePen(PS_SOLID,1,RGB(72,63,65));
bLJS.CreateSolidBrush(RGB(72,63,65));
dc.SelectObject(&pLJS), dc.SelectObject(&bLJS);
POINT array1[] = {{144,121},{275,244},{252,244}};
dc.Polygon(array1,3);
// 가운데 2층 몸체
CPen pMJ;
CBrush bMJ;
pMJ.CreatePen(PS_SOLID,1,RGB(176,187,177));
bMJ.CreateSolidBrush(RGB(176,187,177));
dc.SelectObject(&pMJ), dc.SelectObject(&bMJ);
POINT arr18[] = {{244,245},{244,390},{514,390},{514,381},{497,380},{511,363},{511,274},{548,245}};
dc.Polygon(arr18,8);
// 가운데 2층 몸체 그림자
CPen pMJSS;
CBrush bMJSS;
pMJSS.CreatePen(PS_SOLID,1,RGB(147,152,146));
bMJSS.CreateSolidBrush(RGB(147,152,146));
dc.SelectObject(&pMJSS), dc.SelectObject(&bMJSS);
POINT array3[] = {{244,245},{244,390},{250,390},{250,245}};
dc.Polygon(array3,4);
// 가운데 2층 몸체 그림자2
CPen pMJSS1;
CBrush bMJSS1;
pMJSS1.CreatePen(PS_SOLID,1,RGB(147,152,146));
bMJSS1.CreateSolidBrush(RGB(147,152,146));
dc.SelectObject(&pMJSS1), dc.SelectObject(&bMJSS1);
POINT array4[] = {{250,245},{250,274},{511,274},{548,245}};
dc.Polygon(array4,4);
// 가운데 1층 지붕
CPen pMJ1;
CBrush bMJ1;
pMJ1.CreatePen(PS_SOLID,1,RGB(72,63,65));
bMJ1.CreateSolidBrush(RGB(72,63,65));
dc.SelectObject(&pMJ1), dc.SelectObject(&bMJ1);
POINT arr19[] = {{244,390},{514,390},{514,412},{193,412}};
dc.Polygon(arr19,4);
// 가운데 1층 기둥
CPen pMJ2;
CBrush bMJ2;
pMJ2.CreatePen(PS_SOLID,1,RGB(193,203,214));
bMJ2.CreateSolidBrush(RGB(193,203,214));
dc.SelectObject(&pMJ2), dc.SelectObject(&bMJ2);
POINT arr20[] = {{514,413},{211,413},{211,600},{514,600}};
dc.Polygon(arr20,4);
// 가운데 1층 몸체1
CPen pMJ3;
CBrush bMJ3;
pMJ3.CreatePen(PS_SOLID,1,RGB(132,130,123));
bMJ3.CreateSolidBrush(RGB(132,130,123));
dc.SelectObject(&pMJ3), dc.SelectObject(&bMJ3);
POINT arr21[] = {{230,420},{325,420},{325,570},{230,570}};
dc.Polygon(arr21,4);
// 가운데 1층 몸체2
CPen pMJ4;
CBrush bMJ4;
pMJ4.CreatePen(PS_SOLID,1,RGB(132,130,123));
bMJ4.CreateSolidBrush(RGB(132,130,123));
dc.SelectObject(&pMJ4), dc.SelectObject(&bMJ4);
POINT arr22[] = {{340,420},{507,420},{507,570},{340,570}};
dc.Polygon(arr22,4);
// 문 틀
CPen pMT;
CBrush bMT;
pMT.CreatePen(PS_SOLID,1,RGB(131,134,129));
bMT.CreateSolidBrush(RGB(131,134,129));
dc.SelectObject(&pMT), dc.SelectObject(&bMT);
POINT arr23[] = {{252,420},{325,420},{325,550},{252,550}};
dc.Polygon(arr23,4);
// 문바닥
CPen pMB;
CBrush bMB;
pMB.CreatePen(PS_SOLID,1,RGB(97,100,101));
bMB.CreateSolidBrush(RGB(97,100,101));
dc.SelectObject(&pMB), dc.SelectObject(&bMB);
POINT arr24[] = {{252,550},{325,550},{325,570},{230,570}};
dc.Polygon(arr24,4);
// 문
CPen pM;
CBrush bM;
pM.CreatePen(PS_SOLID,1,RGB(63,51,51));
bM.CreateSolidBrush(RGB(63,51,51));
dc.SelectObject(&pM), dc.SelectObject(&bM);
POINT arr25[] = {{274,445},{316,445},{316,546},{274,546}};
dc.Polygon(arr25,4);
// 문손잡이
CPen pMS;
CBrush bMS;
pMS.CreatePen(PS_SOLID,1,RGB(112,103,63));
bMS.CreateSolidBrush(RGB(112,103,63));
dc.SelectObject(&pMS), dc.SelectObject(&bMS);
POINT arr26[] = {{311,492},{315,492},{315,504},{311,504}};
dc.Polygon(arr26,4);
// 가운데 1층 몸체2 바닥
CPen pMJB;
CBrush bMJB;
pMJB.CreatePen(PS_SOLID,1,RGB(97,100,101));
bMJB.CreateSolidBrush(RGB(97,100,101));
dc.SelectObject(&pMJB), dc.SelectObject(&bMJB);
POINT arr27[] = {{340,550},{507,550},{507,570},{340,570}};
dc.Polygon(arr27,4);
// 문 앞 계단1 얇은줄
CPen pMG;
CBrush bMG;
pMG.CreatePen(PS_SOLID,1,RGB(166,167,168));
bMG.CreateSolidBrush(RGB(166,167,168));
dc.SelectObject(&pMG), dc.SelectObject(&bMG);
POINT arr28[] = {{211,570},{514,570},{514,575},{211,575}};
dc.Polygon(arr28,4);
// 문 앞 계단2 두꺼운줄
CPen pMG1;
CBrush bMG1;
pMG1.CreatePen(PS_SOLID,1,RGB(127,121,107));
bMG1.CreateSolidBrush(RGB(127,121,107));
dc.SelectObject(&pMG1), dc.SelectObject(&bMG1);
POINT arr29[] = {{211,575},{514,575},{514,600},{211,600}};
dc.Polygon(arr29,4);
// 문 앞 계단3 앞면
CPen pMG2;
CBrush bMG2;
pMG2.CreatePen(PS_SOLID,1,RGB(156,157,150));
bMG2.CreateSolidBrush(RGB(156,157,150));
dc.SelectObject(&pMG2), dc.SelectObject(&bMG2);
POINT arr30[] = {{216,585},{320,585},{320,600},{216,600}};
dc.Polygon(arr30,4);
// 문 앞 계단4 윗면
CPen pMG3;
CBrush bMG3;
pMG3.CreatePen(PS_SOLID,1,RGB(238,229,219));
bMG3.CreateSolidBrush(RGB(238,229,219));
dc.SelectObject(&pMG3), dc.SelectObject(&bMG3);
POINT arr31[] = {{216,585},{320,585},{322,583},{218,583}};
dc.Polygon(arr31,4);
// 문 앞 계단5 옆면
CPen pMG4;
CBrush bMG4;
pMG4.CreatePen(PS_SOLID,1,RGB(75,80,75));
bMG4.CreateSolidBrush(RGB(75,80,75));
dc.SelectObject(&pMG4), dc.SelectObject(&bMG4);
POINT arr32[] = {{322,583},{320,585},{320,600},{322,598}};
dc.Polygon(arr32,4);
// 마당길
CPen pMadang;
CBrush bMadang;
pMadang.CreatePen(PS_SOLID,1,RGB(238,229,219));
bMadang.CreateSolidBrush(RGB(238,229,219));
dc.SelectObject(&pMadang), dc.SelectObject(&bMadang);
POINT arr33[] = {{1500,632},{305,625},{320,600},{211,600},{171,635},{1500,648}};
dc.Polygon(arr33,6);
// 창문 옆
CPen pWin;
CBrush bWin;
pWin.CreatePen(PS_SOLID,1,RGB(90,50,50));
bWin.CreateSolidBrush(RGB(90,50,50));
dc.SelectObject(&pWin), dc.SelectObject(&bWin);
POINT arr34[] = {{77,277},{206,277},{206,360},{77,360}};
dc.Polygon(arr34,4);
//
CPen pWin1;
CBrush bWin1;
pWin1.CreatePen(PS_SOLID,1,RGB(90,50,50));
bWin1.CreateSolidBrush(RGB(90,50,50));
dc.SelectObject(&pWin1), dc.SelectObject(&bWin1);
POINT arr35[] = {{66,425},{207,425},{207,517},{66,517}};
dc.Polygon(arr35,4);
//
CPen pWin2;
CBrush bWin2;
pWin2.CreatePen(PS_SOLID,1,RGB(90,50,50));
bWin2.CreateSolidBrush(RGB(90,50,50));
dc.SelectObject(&pWin2), dc.SelectObject(&bWin2);
POINT arr36[] = {{367,286},{501,286},{501,373},{497,378},{367,378}};
dc.Polygon(arr36,5);
//
CPen pWin3;
CBrush bWin3;
pWin3.CreatePen(PS_SOLID,1,RGB(90,50,50));
bWin3.CreateSolidBrush(RGB(90,50,50));
dc.SelectObject(&pWin3), dc.SelectObject(&bWin3);
POINT arr37[] = {{670,271},{748,271},{748,368},{670,368}};
dc.Polygon(arr37,4);
//
CPen pWin4;
CBrush bWin4;
pWin4.CreatePen(PS_SOLID,1,RGB(90,50,50));
bWin4.CreateSolidBrush(RGB(90,50,50));
dc.SelectObject(&pWin4), dc.SelectObject(&bWin4);
POINT arr38[] = {{572,433},{662,433},{662,544},{572,544}};
dc.Polygon(arr38,4);
//
CPen pWin5;
CBrush bWin5;
pWin5.CreatePen(PS_SOLID,1,RGB(90,50,50));
bWin5.CreateSolidBrush(RGB(90,50,50));
dc.SelectObject(&pWin5), dc.SelectObject(&bWin5);
POINT arr39[] = {{754,440},{844,440},{844,544},{754,544}};
dc.Polygon(arr39,4);
// 창문1
CPen pWindow;
CBrush bWindow;
pWindow.CreatePen(PS_SOLID,1,RGB(177,193,202));
bWindow.CreateSolidBrush(RGB(177,193,202));
dc.SelectObject(&pWindow), dc.SelectObject(&bWindow);
POINT arr40[] = {{100,277},{190,277},{190,366},{100,366}};
dc.Polygon(arr40,4);
// 유리1-1
CPen pWindow1;
CBrush bWindow1;
pWindow1.CreatePen(PS_SOLID,1,RGB(92,110,119));
bWindow1.CreateSolidBrush(RGB(92,110,119));
dc.SelectObject(&pWindow1), dc.SelectObject(&bWindow1);
POINT arr41[] = {{104,282},{142,282},{142,360},{104,360}};
dc.Polygon(arr41,4);
// 유리1-2
CPen pWindow2;
CBrush bWindow2;
pWindow2.CreatePen(PS_SOLID,1,RGB(92,110,119));
bWindow2.CreateSolidBrush(RGB(92,110,119));
dc.SelectObject(&pWindow2), dc.SelectObject(&bWindow2);
POINT arr42[] = {{148,282},{185,282},{185,360},{148,360}};
dc.Polygon(arr42,4);
// 창문2
CPen pWindow3;
CBrush bWindow3;
pWindow3.CreatePen(PS_SOLID,1,RGB(177,193,202));
bWindow3.CreateSolidBrush(RGB(177,193,202));
dc.SelectObject(&pWindow3), dc.SelectObject(&bWindow3);
POINT arr43[] = {{87,425},{192,425},{192,523},{87,523}};
dc.Polygon(arr43,4);
// 유리2-1
CPen pWindow4;
CBrush bWindow4;
pWindow4.CreatePen(PS_SOLID,1,RGB(44,46,43));
bWindow4.CreateSolidBrush(RGB(44,46,43));
dc.SelectObject(&pWindow4), dc.SelectObject(&bWindow4);
POINT arr44[] = {{93,428},{112,428},{112,517},{93,517}};
dc.Polygon(arr44,4);
// 유리2-2
CPen pWindow5;
CBrush bWindow5;
pWindow5.CreatePen(PS_SOLID,1,RGB(44,46,43));
bWindow5.CreateSolidBrush(RGB(44,46,43));
dc.SelectObject(&pWindow5), dc.SelectObject(&bWindow5);
POINT arr45[] = {{122,428},{158,428},{158,517},{122,517}};
dc.Polygon(arr45,4);
// 유리2-3
CPen pWindow6;
CBrush bWindow6;
pWindow6.CreatePen(PS_SOLID,1,RGB(44,46,43));
bWindow6.CreateSolidBrush(RGB(44,46,43));
dc.SelectObject(&pWindow6), dc.SelectObject(&bWindow6);
POINT arr46[] = {{167,428},{189,428},{189,517},{167,517}};
dc.Polygon(arr46,4);
// 창문3
CPen pWindow7;
CBrush bWindow7;
pWindow7.CreatePen(PS_SOLID,1,RGB(177,193,202));
bWindow7.CreateSolidBrush(RGB(177,193,202));
dc.SelectObject(&pWindow7), dc.SelectObject(&bWindow7);
POINT arr47[] = {{387,286},{480,286},{480,381},{387,381}};
dc.Polygon(arr47,4);
// 유리3-1
CPen pWindow8;
CBrush bWindow8;
pWindow8.CreatePen(PS_SOLID,1,RGB(44,46,43));
bWindow8.CreateSolidBrush(RGB(44,46,43));
dc.SelectObject(&pWindow8), dc.SelectObject(&bWindow8);
POINT arr48[] = {{391,290},{431,290},{431,378},{391,378}};
dc.Polygon(arr48,4);
// 유리3-2
CPen pWindow9;
CBrush bWindow9;
pWindow9.CreatePen(PS_SOLID,1,RGB(44,46,43));
bWindow9.CreateSolidBrush(RGB(44,46,43));
dc.SelectObject(&pWindow9), dc.SelectObject(&bWindow9);
POINT arr49[] = {{439,290},{476,290},{476,378},{439,378}};
dc.Polygon(arr49,4);
// 가운데 창문
CPen pWindow10;
CBrush bWindow10;
pWindow10.CreatePen(PS_SOLID,1,RGB(177,193,202));
bWindow10.CreateSolidBrush(RGB(177,193,202));
dc.SelectObject(&pWindow10), dc.SelectObject(&bWindow10);
POINT arr50[] = {{257,286},{328,286},{327,381},{254,381}};
dc.Polygon(arr50,4);
// 창문4
CPen pWindow11;
CBrush bWindow11;
pWindow11.CreatePen(PS_SOLID,1,RGB(177,193,202));
bWindow11.CreateSolidBrush(RGB(177,193,202));
dc.SelectObject(&pWindow11), dc.SelectObject(&bWindow11);
POINT arr51[] = {{687,271},{729,271},{729,371},{687,371}};
dc.Polygon(arr51,4);
// 유리4
CPen pWindow12;
CBrush bWindow12;
pWindow12.CreatePen(PS_SOLID,1,RGB(94,113,120));
bWindow12.CreateSolidBrush(RGB(94,113,120));
dc.SelectObject(&pWindow12), dc.SelectObject(&bWindow12);
POINT arr52[] = {{691,275},{722,275},{722,368},{691,368}};
dc.Polygon(arr52,4);
// 창문5
CPen pWindow13;
CBrush bWindow13;
pWindow13.CreatePen(PS_SOLID,1,RGB(177,193,202));
bWindow13.CreateSolidBrush(RGB(177,193,202));
dc.SelectObject(&pWindow13), dc.SelectObject(&bWindow13);
POINT arr53[] = {{595,433},{638,433},{638,550},{595,550}};
dc.Polygon(arr53,4);
// 유리5
CPen pWindow14;
CBrush bWindow14;
pWindow14.CreatePen(PS_SOLID,1,RGB(40,43,39));
bWindow14.CreateSolidBrush(RGB(40,43,39));
dc.SelectObject(&pWindow14), dc.SelectObject(&bWindow14);
POINT arr54[] = {{599,436},{635,436},{635,544},{599,544}};
dc.Polygon(arr54,4);
// 창문6
CPen pWindow15;
CBrush bWindow15;
pWindow15.CreatePen(PS_SOLID,1,RGB(177,193,202));
bWindow15.CreateSolidBrush(RGB(177,193,202));
dc.SelectObject(&pWindow15), dc.SelectObject(&bWindow15);
POINT arr55[] = {{778,440},{823,440},{823,548},{778,548}};
dc.Polygon(arr55,4);
// 유리6
CPen pWindow16;
CBrush bWindow16;
pWindow16.CreatePen(PS_SOLID,1,RGB(43,46,40));
bWindow16.CreateSolidBrush(RGB(43,46,40));
dc.SelectObject(&pWindow16), dc.SelectObject(&bWindow16);
POINT arr56[] = {{781,444},{818,444},{818,544},{781,544}};
dc.Polygon(arr56,4);
// 가운데창문 유리1
CPen pWindow17;
CBrush bWindow17;
pWindow17.CreatePen(PS_SOLID,1,RGB(112,132,142));
bWindow17.CreateSolidBrush(RGB(112,132,142));
dc.SelectObject(&pWindow17), dc.SelectObject(&bWindow17);
POINT arr57[] = {{259,290},{267,290},{267,378},{259,378}};
dc.Polygon(arr57,4);
// 가운데창문 유리2
CPen pWindow18;
CBrush bWindow18;
pWindow18.CreatePen(PS_SOLID,1,RGB(112,132,142));
bWindow18.CreateSolidBrush(RGB(112,132,142));
dc.SelectObject(&pWindow18), dc.SelectObject(&bWindow18);
POINT arr58[] = {{275,290},{308,290},{308,378},{275,378}};
dc.Polygon(arr58,4);
// 가운데창문 유리3
CPen pWindow19;
CBrush bWindow19;
pWindow19.CreatePen(PS_SOLID,1,RGB(112,132,142));
bWindow19.CreateSolidBrush(RGB(112,132,142));
dc.SelectObject(&pWindow19), dc.SelectObject(&bWindow19);
POINT arr59[] = {{315,290},{323,290},{323,378},{315,378}};
dc.Polygon(arr59,4);
// 문쪽 창문
CPen pWindow20;
CBrush bWindow20;
pWindow20.CreatePen(PS_SOLID,1,RGB(170,174,170));
bWindow20.CreateSolidBrush(RGB(170,174,170));
dc.SelectObject(&pWindow20), dc.SelectObject(&bWindow20);
POINT arr60[] = {{381,425},{485,425},{485,523},{381,523}};
dc.Polygon(arr60,4);
// 문쪽 유리1
CPen pWindow21;
CBrush bWindow21;
pWindow21.CreatePen(PS_SOLID,1,RGB(30,30,30));
bWindow21.CreateSolidBrush(RGB(30,30,30));
dc.SelectObject(&pWindow21), dc.SelectObject(&bWindow21);
POINT arr61[] = {{384,431},{405,431},{405,518},{384,518}};
dc.Polygon(arr61,4);
// 문쪽 유리2
CPen pWindow22;
CBrush bWindow22;
pWindow22.CreatePen(PS_SOLID,1,RGB(30,30,30));
bWindow22.CreateSolidBrush(RGB(30,30,30));
dc.SelectObject(&pWindow22), dc.SelectObject(&bWindow22);
POINT arr62[] = {{415,431},{452,431},{452,518},{415,518}};
dc.Polygon(arr62,4);
// 문쪽 유리3
CPen pWindow23;
CBrush bWindow23;
pWindow23.CreatePen(PS_SOLID,1,RGB(30,30,30));
bWindow23.CreateSolidBrush(RGB(30,30,30));
dc.SelectObject(&pWindow23), dc.SelectObject(&bWindow23);
POINT arr63[] = {{461,431},{480,431},{480,517},{461,517}};
dc.Polygon(arr63,4);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CProjectNameView printing
BOOL CProjectNameView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CProjectNameView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CProjectNameView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CProjectNameView diagnostics
#ifdef _DEBUG
void CProjectNameView::AssertValid() const
{
CView::AssertValid();
}
void CProjectNameView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CProjectNameDoc* CProjectNameView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CProjectNameDoc)));
return (CProjectNameDoc*)m_pDocument;
}
#endif //_DEBUG
// MainFrame.cpp
#include "stdafx.h"
#include "ProjectName.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG