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
MirrorLine.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++
- // MirrorLine.cpp: implementation of the CMirrorLine class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "MirrorLine.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CMirrorLine::CMirrorLine()
- {
- }
- CMirrorLine::CMirrorLine(CShape *Shape)
- {
- if (Shape != NULL)
- {
- SourceBeginPos = Shape->m_ptFirstPos;
- SourceEndPos = Shape->m_ptSecondPos;
- }
- }
- CMirrorLine::~CMirrorLine()
- {
- }
- void CMirrorLine::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);
- SetSinCos(BeginPos,PrePos);
- SetMirrorPos(BeginPos,PrePos);
- //擦去前一次线段
- CDraw::DrawLine(hdc,MirrorBeginPos,MirrorEndPos);
- SetSinCos(BeginPos,EndPos);
- SetMirrorPos(BeginPos,EndPos);
- //画出这一次线段
- CDraw::DrawLine(hdc,MirrorBeginPos,MirrorEndPos);
- ::SetROP2(hdc,nOldMode);
- ::SelectObject(hdc,hOldPen);
- ::DeleteObject(hPen);
- }