Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
MyDraw.h
Package: MiniCAD_ALL.zip [view]
Upload User: netltd
Upload Date: 2013-02-12
Package Size: 7234k
Code Size: 2k
Category:
Graph Drawing
Development Platform:
Visual C++
- //绘制直线、矩形、圆等图形对象,应该与图形对象的具体数据结构无关
- class CDrawGrapObject : public CObject
- {
- public:
- CDrawGrapObject();
- void Initialize();
- void SetOnceFlag();
- private:
- BOOL OnceFlag;
- public:
- //绘图时基于CDC, (0,0)点为窗口区的左上角
- //绘制直线
- void DrawLineXOR(CDC* pDC, POINT StartPoint, POINT EndPoint, POINT oldEndPoint); //用异或擦除旧的直线,并用异或绘制新的直线
- void DrawLine(CDC* pDC, POINT StartPoint, POINT EndPoint, int LineStyle, COLORREF PenColor); //直接绘制新的直线
- void CancelDrawLine(CDC* pDC, POINT StartPoint, POINT EndPoint); //用异或擦除旧的直线
- void DrawSelLine(CDC* pDC, POINT StartPoint, POINT EndPoint, int LineStyle, COLORREF PenColor);
- public:
- //绘制矩形
- void DrawRectXOR(CDC* pDC, POINT StartPoint, POINT EndPoint, POINT oldEndPoint);
- void DrawRect(CDC* pDC, POINT StartPoint, POINT EndPoint, int LineStyle, COLORREF PenColor);
- void CancelDrawRect(CDC* pDC, POINT StartPoint, POINT EndPoint);
- void DrawSelRect(CDC* pDC, POINT StartPoint, POINT EndPoint, int Style, COLORREF Color);
- public:
- //绘制圆
- void DrawCircleXOR(CDC* pDC, POINT StartPoint, POINT EndPoint, POINT oldEndPoint);
- void DrawCircle(CDC* pDC, POINT StartPoint, POINT EndPoint, int LineStyle, COLORREF PenColor);
- void DrawCircle(CDC* pDC, POINT StartPoint, long Radius, int LineStyle, COLORREF PenColor);
- void CancelDrawCircle(CDC* pDC, POINT StartPoint, POINT EndPoint);
- void DrawSelCircle(CDC* pDC, POINT StartPoint, long Radius, int Style, COLORREF Color);
- public:
- //绘制圆弧
- void DrawArcXOR(CDC* pDC, POINT StartPoint, POINT MidPoint, POINT oldMidPoint,
- POINT EndPoint, POINT oldEndPoint, int times);
- void DrawArc(CDC* pDC, POINT StartPoint, POINT MidPoint, POINT EndPoint, int LineStyle,
- COLORREF PenColor);
- void DrawArc(CDC* pDC, POINT OriginPoint, POINT StartPoint, POINT EndPoint, long Radius,
- int LineStyle, COLORREF PenColor);
- void CancelDrawArc(CDC* pDC, POINT StartPoint, POINT MidPoint, POINT EndPoint, int times);
- void DrawSelArc(CDC* pDC, POINT OriginPoint, POINT StartPoint, POINT EndPoint,
- long Radius, int LineStyle, COLORREF PenColor);
- };