// DrawRect.cpp : 구현 파일입니다.
//

#include "stdafx.h"
#include "paint.h"
#include "DrawElli.h"
#include "paintDoc.h"


// CDrawRect

IMPLEMENT_DYNCREATE(CDrawElli, CData)

CDrawElli::CDrawElli()
{

}

CDrawElli::~CDrawElli()
{
}

BEGIN_MESSAGE_MAP(CDrawElli, CData)
END_MESSAGE_MAP()


// CDrawRect 그리기입니다.

void CDrawElli::OnDraw(CDC *pDC)
{
	CPen pen(PS_SOLID, m_LineSize, m_penRGB);
	CBrush NewBrush;
	pDC -> SelectObject(&pen);
	NewBrush.CreateSolidBrush(m_brush);
	pDC -> SelectObject(&NewBrush);	
	pDC -> Ellipse(m_ptHead.x, m_ptHead.y, m_ptTail.x, m_ptTail.y);

}

void CDrawElli::Serialize(CArchive &ar)
{
	ar << ELLIPSE;
	// save class data	
	ar << m_Dtype;
	ar << m_ptHead;
	ar << m_ptTail;
	ar << m_nlineCnt;
	ar << m_penRGB;
	ar << m_brush;
	ar << m_LineSize;

}//Serialize()

void CDrawElli::Deserialize(CArchive &ar)
{
	ar >> m_Dtype;
	ar >> m_ptHead;
	ar >> m_ptTail;
	ar >> m_nlineCnt;
	ar >> m_penRGB;
	ar >> m_brush;
	ar >> m_LineSize;

}//Serialize()


void CDrawElli::OnLBDN(CPoint point)
{
	m_ptHead = point;
};

void CDrawElli::OnLBUP(CPoint point)
{
	m_ptTail = point;
};


void CDrawElli::Attri(int m_LineSize2)
{

	m_LineSize = m_LineSize2;
}

void CDrawElli::m_RGB(COLORREF m_penRGB2, COLORREF m_brush2)
{
	m_penRGB = m_penRGB2;
	m_brush = m_brush2;
}