57 lines
		
	
	
		
			739 B
		
	
	
	
		
			C++
		
	
	
	
		
		
			
		
	
	
			57 lines
		
	
	
		
			739 B
		
	
	
	
		
			C++
		
	
	
	
|  | #include "..\..\Easy2d.h"
 | |||
|  | #include "..\..\EasyX\easyx.h"
 | |||
|  | 
 | |||
|  | Shape::Shape() | |||
|  | { | |||
|  | } | |||
|  | 
 | |||
|  | Shape::~Shape() | |||
|  | { | |||
|  | } | |||
|  | 
 | |||
|  | void Shape::_onDraw() | |||
|  | { | |||
|  | 	// <20><>״<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ
 | |||
|  | 	if (!m_bDisplay)  | |||
|  | 	{ | |||
|  | 		return; | |||
|  | 	} | |||
|  | 	// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
 | |||
|  | 	setlinecolor(lineColor); | |||
|  | 	setfillcolor(fillColor); | |||
|  | 
 | |||
|  | 	// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״<EFBFBD><D7B4><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>в<EFBFBD>ͬ<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD>
 | |||
|  | 	if (_style == Shape::STYLE::round)  | |||
|  | 	{ | |||
|  | 		roundShape(); | |||
|  | 	} | |||
|  | 	else if (_style == Shape::STYLE::solid)  | |||
|  | 	{ | |||
|  | 		solidShape(); | |||
|  | 	} | |||
|  | 	else if (_style == Shape::STYLE::fill)  | |||
|  | 	{ | |||
|  | 		fillShape(); | |||
|  | 	} | |||
|  | } | |||
|  | 
 | |||
|  | inline COLORREF Shape::getFillColor() const | |||
|  | { | |||
|  | 	return fillColor; | |||
|  | } | |||
|  | 
 | |||
|  | inline COLORREF Shape::getLineColor() const | |||
|  | { | |||
|  | 	return lineColor; | |||
|  | } | |||
|  | 
 | |||
|  | void Shape::setFillColor(COLORREF color) | |||
|  | { | |||
|  | 	fillColor = color; | |||
|  | } | |||
|  | 
 | |||
|  | void Shape::setLineColor(COLORREF color) | |||
|  | { | |||
|  | 	lineColor = color; | |||
|  | } |