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

📄 cdellipse.cpp

📁 Wince 下的画图软件的源代码,是一款不错的EVC图形编辑软件,可以直接作为PMP的配套软件.
💻 CPP
字号:
#include "stdafx.h"
#include"CDEllipse.h"

//#include "test1View.h"

IMPLEMENT_SERIAL(CDEllipse,CUnit,1)
void CDEllipse::DrawStatic(CDC*pDC)
{
	/*

	CPen m_pen;
	m_pen.CreatePen(PS_SOLID,2,m_PenColor);
	CPen* pen=(CPen*)pDC->SelectObject(&m_pen);

	if(m_transparence)
	pDC->SelectStockObject(NULL_BRUSH);
	else
	{
	CBrush m_brush;
	m_brush.CreateSolidBrush(m_BackgroundColor);
	pDC->SelectObject(&m_brush);
	}
	pDC->Ellipse(m_FirstPoint.x,m_FirstPoint.y,m_SecondPoint.x,m_SecondPoint.y);
	*/
	HPEN m_pen,m_oldpen;
	m_pen=CreatePen(m_PenStyle,m_PenWidth,m_PenColor);
	m_oldpen=(HPEN)SelectObject(hMemDC,m_pen);
	if(m_transparence)
		SelectObject(hMemDC,GetStockObject(NULL_BRUSH));
	else
	{
		HBRUSH m_brush;
		m_brush=CreateSolidBrush(m_BackgroundColor);
		SelectObject(hMemDC,m_brush);
	}
	Ellipse(hMemDC,m_FirstPoint.x,m_FirstPoint.y,m_SecondPoint.x,m_SecondPoint.y);
	BitBlt(pDC->m_hDC, 0, 0, iScreenWidth,iScreenHeight,hMemDC,0, 0, SRCCOPY); 
	
}

CDEllipse::CDEllipse()
{ 
	CUnit::Initial();
	
	
}



void CDEllipse::Initial()
{
	m_FirstPoint=0;
	m_SecondPoint=0;
	m_PenColor=RGB(0,0,0);
	m_PenWidth=2;
	m_PenStyle=PS_SOLID;
}




void CDEllipse::DrawActive(CDC *pDC,CPoint point,char cPress)
{ 
	if(cPress==CMD_LBMOVE)
	{
		CPen m_pen;
		m_pen.CreatePen(m_PenStyle,m_PenWidth,m_PenColor);
		CPen* pen=(CPen*)pDC->SelectObject(&m_pen);
		
		BitBlt(pDC->m_hDC, 0, 0, iScreenWidth,iScreenHeight,hMemDC,0, 0	, SRCCOPY); 

		if(m_transparence)
			pDC->SelectStockObject(NULL_BRUSH);
		else
		{
			CBrush m_brush;
			m_brush.CreateSolidBrush(m_BackgroundColor);
			pDC->SelectObject(&m_brush);
		}		
		pDC->Ellipse(m_FirstPoint.x,m_FirstPoint.y,m_SecondPoint.x,m_SecondPoint.y);
	}
	else
	{
		
		HPEN m_pen,m_oldpen;
		m_pen=CreatePen(m_PenStyle,m_PenWidth,m_PenColor);
		m_oldpen=(HPEN)SelectObject(hMemDC,m_pen);
		if(m_transparence)
			SelectObject(hMemDC,GetStockObject(NULL_BRUSH));
		else
		{
			HBRUSH m_brush;
			m_brush=CreateSolidBrush(m_BackgroundColor);
			SelectObject(hMemDC,m_brush);
		}
		Ellipse(hMemDC,m_FirstPoint.x,m_FirstPoint.y,m_SecondPoint.x,m_SecondPoint.y);
		BitBlt(pDC->m_hDC, 0, 0, iScreenWidth,iScreenHeight,hMemDC,0, 0, SRCCOPY);
	}
}


⌨️ 快捷键说明

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