Circle.cpp
资源名称:视频会议系统.rar [点击查看]
上传用户:popouu88
上传日期:2013-02-11
资源大小:2894k
文件大小:1k
源码类别:
IP电话/视频会议
开发平台:
Visual C++
- // Circle.cpp: implementation of the CCircle class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "Circle.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CCircle::CCircle( CDrawView * view ) : CDraw( view )
- {
- this->type = CIRCLE;
- }
- CCircle::~CCircle()
- {
- }
- void CCircle::MouseMove( UINT nFlags , CPoint point )
- {
- if( nFlags & MK_SHIFT )
- { //计算最小的边
- int min = min( abs( point.x - this->start.x ) , abs( point.y - this->start.y ) );
- //计算最小的矩形
- point.x = this->start.x + ( point.x > this->start.x ? 1 : -1 ) * min;
- point.y = this->start.y + ( point.y > this->start.y ? 1 : -1 ) * min;
- }
- CDraw::MouseMove( nFlags , point );
- }
- CDC * CCircle::Draw( CDC * pDC )
- {
- pDC = CDraw::Draw( pDC );
- if( pDC )
- {
- CRect rc( this->start , this->end );
- rc.NormalizeRect( );
- pDC->Ellipse( rc );
- }
- return pDC;
- }