⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 roundrect.cpp

📁 电子白板程序
💻 CPP
字号:
// RoundRect.cpp: implementation of the CRoundRect class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "RoundRect.h"
#include "DrawView.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CRoundRect::CRoundRect( CDrawView & v ) : CLine( v )
{
	this->draw.tag = ROUNDRECT;
}

CRoundRect::~CRoundRect()
{

}

CDrawBase * CRoundRect::Clone( void )
{
	CRoundRect * obj =new CRoundRect( this->view );

	memcpy( &obj->draw , &this->draw , sizeof( DRAW ) );

	return obj;
}

bool CRoundRect::Select( CRect & rc )
{
	CRect compare;

	rc.NormalizeRect();
	
	CRect r( this->draw.start , this->draw.end );
	
	r.NormalizeRect();

	compare.IntersectRect( &rc , &r );
	
	if( this->draw.brush.lbStyle == BS_NULL )
		
		this->draw_select = ! compare.IsRectEmpty() && ! compare.EqualRect( rc );

	else

		this->draw_select = ! compare.IsRectEmpty();

	return this->draw_select;
}

void CRoundRect::OnDraw( CDC * pDC )
{
	CDrawBase::OnDraw( pDC );

	CRect rc( draw.start , draw.end );
	
	rc.NormalizeRect( );
	
	pDC->RoundRect( rc , CPoint( 20 , 20 ) );
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -