Click here to Skip to main content
15,890,512 members
Articles / Multimedia / GDI
Article

A Free Draw Library: Easy to Snap/zoom/undo/redo/copy/paste

Rate me:
Please Sign up or sign in to vote.
1.23/5 (21 votes)
4 Jul 2007CPOL1 min read 46.1K   1.5K   25   6
A free draw you can use my example to do

Introduction

In this article, I introduce a draw library I wrote. It is easy to use for drawing shapes and managing shapes. It provides common features, such as zoom/undo/redo/copy/paste, and I provide a sample of how to use it.

Draw

Background

A good draw can help us to solve some problems. For example, maybe you want a draw tool to get the max position and min position when you view the audio wave or other wave. I got the idea when I analyzed voice two years ago. So I wrote a draw library.

Using the Code

You can build my example and run it. I have provided a release version and a debug version. Also, I provided another demo that uses my draw library. All classes:

C++
class CRTObject
class CRTShape
class CRTLine 
....... Other shapes
class CRTAction
class CRTAddAction 
class CRTModifyAction 
class CRTRemoveAction
class CRTTool
class CRTDrawTool
class CRTLineTool 
...... Other DrawTools
class CRTViewTool 
class CRTModifyTool
class CRTSelectTool 
class CRTRemoveTool
class CRTDrawView 
class CRTDrawDoc 
class CRTObjectsList
class CRTShapesList
class CRTDataMgr 
class CRTViewEnv 
class CRTDrawParam 
class CRTClipboard 
class CRTDC
class CRTMath 
class RTPoint 
class RTRect 
class RTSize

You can use CRTViewTool to zoom, use CRTActionMgr to do undo/redo and use CRTClipboard to do copy/cut/paste. I will continue to add some features and some classes. I am glad and happy if you tell me you use my draw library. And I will tell you how to use it if you need my help. The source code is not public, but the library is free and you can use it. In the ZIP package, there is an RTDemon application. You can download the latest version here: RTDemon.zip.You can also download the latest RTDesktopDraw ZIP file. There are some bugs in RTDraw. I will fix them and improve the reliability and stability of RTDraw.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
China China
the Realtang Webmaster of www.realtang.com

Comments and Discussions

 
QuestionCould you public all the code? Pin
coldcat18-May-10 21:57
coldcat18-May-10 21:57 
GeneralMy vote of 1 Pin
Octopod28-Aug-09 11:06
Octopod28-Aug-09 11:06 
QuestionWhere is the source code of the library? Pin
transoft26-Jun-07 17:12
transoft26-Jun-07 17:12 
AnswerRe: Where is the source code of the library? Pin
realtang26-Jun-07 17:46
realtang26-Jun-07 17:46 
GeneralRe: Where is the source code of the library? Pin
Kochise27-Jun-07 5:40
Kochise27-Jun-07 5:40 
GeneralGreat work! Pin
kellyonlyone26-Jun-07 3:35
sponsorkellyonlyone26-Jun-07 3:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.