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.
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:
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.