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
MirrorCircle.cpp
Package: TCAD.rar [view]
Upload User: ggmm7909
Upload Date: 2008-11-12
Package Size: 80k
Code Size: 1k
Category:
Graph Drawing
Development Platform:
C/C++
- // MirrorCircle.cpp: implementation of the CMirrorCircle class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "MirrorCircle.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CMirrorCircle::CMirrorCircle()
- {
- }
- CMirrorCircle::CMirrorCircle(CShape *Shape)
- {
- if (Shape != NULL)
- {
- SourceBeginPos = Shape->m_ptFirstPos;
- SourceEndPos = Shape->m_ptSecondPos;
- nRadius = CDraw::Distance(SourceBeginPos,SourceEndPos);
- }
- }
- CMirrorCircle::~CMirrorCircle()
- {
- }
- void CMirrorCircle::Mirror(HDC hdc,POINT BeginPos,POINT PrePos, POINT EndPos)
- {
- int nOldMode = ::SetROP2(hdc,R2_XORPEN);
- HPEN hPen = ::CreatePen( m_PenStyle,
- m_PenWidth,
- m_PenColor^ GetBkColor(hdc) );
- HPEN hOldPen = (HPEN)::SelectObject(hdc,hPen);
- //不进行填充
- ::SelectObject(hdc,GetStockObject(NULL_BRUSH));
- SetSinCos(BeginPos,PrePos);
- SetMirrorPos(BeginPos,PrePos);
- //擦去前一次线段
- CDraw::DrawCircle(hdc,MirrorBeginPos,nRadius);
- SetSinCos(BeginPos,EndPos);
- SetMirrorPos(BeginPos,EndPos);
- //画出这一次线段
- CDraw::DrawCircle(hdc,MirrorBeginPos,nRadius);
- ::SetROP2(hdc,nOldMode);
- ::SelectObject(hdc,hOldPen);
- ::DeleteObject(hPen);
- }