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

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

// CDrawLine

IMPLEMENT_DYNCREATE(CDrawLine, CData)

CDrawLine::CDrawLine()
{

}

CDrawLine::~CDrawLine()
{
}

BEGIN_MESSAGE_MAP(CDrawLine, CData)
END_MESSAGE_MAP()


// CDrawLine 그리기입니다.

void CDrawLine::OnDraw(CDC *pDC)
{
	
	CPen pen(PS_SOLID, m_LineSize, m_penRGB);
	pDC -> SelectObject(&pen);
	pDC -> MoveTo(m_ptHead);
	pDC -> LineTo(m_ptTail);
		
}

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

}//Serialize()

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

}//Serialize()


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

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


void CDrawLine::Attri(int m_LineSize2)
{

	m_LineSize = m_LineSize2;
}

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