资源简介
基于VS6.0 C++的完整的基本图形绘制系统,矢量图开发
代码片段和文件信息
#include “stdafx.h“
#include “CCurve.h“
#include“EastDrawView.h“
IMPLEMENT_SERIAL(CCurveCobject1)
void CCurve::DrawStatic(CDC*pDC)
{
CPen m_pen;
m_pen.CreatePen(m_Penstylem_PenWidthm_PenColor);
CPen* pen=(CPen*)pDC->Selectobject(&m_pen);
int oldDrawingMode=pDC->SetROP2(m_DrawingMode);
m_FirstPoint=m_PointList->GetAt(0);
pDC->MoveTo(m_FirstPoint);
for(int i=0;iGetSize();i++)
{
pDC->LineTo(m_PointList->GetAt(i));
pDC->LineTo(m_PointList->GetAt(i));
}
pDC->LineTo(m_PointList->GetAt(i-1));
pDC->Selectobject(pen);
pDC->SetROP2(oldDrawingMode);
}
int CCurve::IsOnMarginPoint(CPoint point)
{
CRect rect;
for(int i=0;iGetSize();i=i+10)
{
rect=CRect(m_PointList->GetAt(i)m_PointList->GetAt(i));
rect.InflateRect(44);
if(rect.PtInRect(point))
{
m_FoundPoint=m_PointList->GetAt(i);
return i+i;
}
}
return -1;
}
void CCurve::Initial()
{
CUnit::Initial();
m_PointList=new CArray;
}
void CCurve::Serialize(CArchive &ar)
{
if(ar.IsStoring())
{
ar<yle< }
else
{
ar>>m_PenColor>>m_Penstyle>>m_PenWidth;
}
m_PointList->Serialize(ar);
}
CCurve::CCurve()
{
Initial();
}
void CCurve::DrawMask(CDC*pDCCPoint firstCPoint second)
{
CPen m_pen;
m_pen.CreatePen(m_Penstylem_PenWidthm_PenColor);
CPen* pen=(CPen*)pDC->Selectobject(&m_pen);
pDC->MoveTo(first);
pDC->LineTo(second);
pDC->Selectobject(pen);
}
BOOL CCurve::IsInRgn(CPoint point)
{
CRect rect;
for(int i=0;iGetSize();i++)
{
rect=CRect(m_PointList->GetAt(i)m_PointList->GetAt(i));
rect.InflateRect(99);
if(rect.PtInRect(point))
return i;
}
return -1;
}
void CCurve::ShowSelectPoint(CDC *pDC)
{
CRect rect;
CBrush brush;
brush.CreateSolidBrush(RGB(25500));
CPen m_pen;
m_pen.CreatePen(PS_SOLID1RGB(00255));
CPen *OldPen=pDC->Selectobject(&m_pen);
int oldBkMode=pDC->SetBkMode(OPAQUE);
CBrush *OldBrush=pDC->Selectobject(&brush);
int oldDrawingMode=pDC->SetROP2(R2_NOTXORPEN);
for(int i=0;iGetSize();i=i+10)
{
rect=CRect(m_PointList->GetAt(i)m_PointList->GetAt(i));
rect.InflateRect(33);
pDC->Rectangle(rect);
}
pDC->Selectobject(OldPen);
pDC->SetBkMode(oldBkMode);
pDC->Selectobject(OldBrush);
pDC->SetROP2(oldDrawingMode);
}
CRect CCurve::GetBoundingRect()
{
m_MinPoint=m_MaxPoint=m_PointList->GetAt(0);
for(int i=0;iGetSize();i++)
{
m_MinPoint.x=min(m_MinPoint.xm_PointList->GetAt(i).x);
m_MinPoint.y=min(m_MinPoint.ym_PointList->GetAt(i).y);
m_MaxPoint.x=max(m_MaxPoint.xm_PointList->GetAt(i).x);
m_MaxPoint.y=max(m_MaxPoint.ym_PointList->GetAt(i).y);
}
this->m_BoundingRect.SetRect(this->m_MinPointthis->m_MaxPoint);
return this->m_BoundingRect;
}
void CCurve::DrawActive(CDC *pDCCPoint point)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
.CA.... 4484 2002-06-09 01:14 完整的基本图形绘制系统\EastDraw\CCurve.cpp
.CA.... 657 2002-05-28 09:57 完整的基本图形绘制系统\EastDraw\CCurve.h
.CA.... 8526 2002-06-15 16:46 完整的基本图形绘制系统\EastDraw\CDLine.cpp
.CA.... 603 2002-05-28 14:52 完整的基本图形绘制系统\EastDraw\CDLine.h
.CA.... 15702 2002-09-01 12:05 完整的基本图形绘制系统\EastDraw\CEllipse.cpp
.CA.... 1365 2002-05-31 10:49 完整的基本图形绘制系统\EastDraw\CEllipse.h
.CA.... 14047 2002-06-09 20:08 完整的基本图形绘制系统\EastDraw\CEllipseArc.cpp
.CA.... 1490 2002-06-09 00:42 完整的基本图形绘制系统\EastDraw\CEllipseArc.h
.CA.... 1535 2002-09-03 09:53 完整的基本图形绘制系统\EastDraw\ChildFrm.cpp
.CA.... 1397 2002-09-03 09:53 完整的基本图形绘制系统\EastDraw\ChildFrm.h
.CA.... 7803 2002-06-09 12:24 完整的基本图形绘制系统\EastDraw\CLiEllipse.cpp
.CA.... 566 2002-05-28 10:04 完整的基本图形绘制系统\EastDraw\CLiEllipse.h
.CA.... 7867 2002-06-21 17:18 完整的基本图形绘制系统\EastDraw\CPolyBezier.cpp
.CA.... 753 2002-05-31 10:51 完整的基本图形绘制系统\EastDraw\CPolyBezier.h
.CA.... 12076 2002-06-09 12:26 完整的基本图形绘制系统\EastDraw\CPolygon.cpp
.CA.... 731 2002-05-28 10:03 完整的基本图形绘制系统\EastDraw\CPolygon.h
.CA.... 7452 2002-06-23 21:40 完整的基本图形绘制系统\EastDraw\CRectangle.cpp
.CA.... 559 2002-05-28 10:03 完整的基本图形绘制系统\EastDraw\CRectangle.h
.CA.... 8889 2002-06-23 21:35 完整的基本图形绘制系统\EastDraw\CRound.cpp
.CA.... 605 2002-05-28 10:03 完整的基本图形绘制系统\EastDraw\CRound.h
.CA.... 8343 2002-06-24 11:30 完整的基本图形绘制系统\EastDraw\CRoundArc.cpp
.CA.... 690 2002-05-28 10:03 完整的基本图形绘制系统\EastDraw\CRoundArc.h
.CA.... 8290 2002-06-23 23:06 完整的基本图形绘制系统\EastDraw\CRoundRectangle.cpp
.CA.... 587 2002-05-28 10:03 完整的基本图形绘制系统\EastDraw\CRoundRectangle.h
.CA.... 11102 2002-07-23 08:36 完整的基本图形绘制系统\EastDraw\CText.cpp
.CA.... 899 2002-05-30 15:01 完整的基本图形绘制系统\EastDraw\CText.h
.CA.... 4944 2002-06-24 09:05 完整的基本图形绘制系统\EastDraw\CUnit.cpp
.CA.... 3883 2002-06-09 12:21 完整的基本图形绘制系统\EastDraw\CUnit.h
.CA.... 9709 2002-06-17 17:35 完整的基本图形绘制系统\EastDraw\DLineDlg1.cpp
.CA.... 2433 2002-06-12 23:30 完整的基本图形绘制系统\EastDraw\DLineDlg1.h
............此处省略69个文件信息
评论
共有 条评论