Shortly after entry, the company's original one automatically generates WORD Based on the template Program You can also use this program to create a word program. The framework has been created, but some functions are not yet complete. It is a test of ability. I have received this task, and after three months of hard work, I am in a bad situation.
I have been learning GDI + and Graphic programming for the last two weeks. He uses the teaching materials of Mahesh Chand and Han Jiang.
Yesterday, the Director gave me a website after reading the book.
Http://www.codeproject.com/KB/cs/DrawToolsRedux.aspx
A drawing tool developed by foreigners. Let me see the design structure of others. And tell me about the storage and other functions, just look at the painting that part is OK.
today is the second day of the program. I am familiar with drawing functions. It is mainly understood from the design framework. I am interested in this and want to develop the architecture.
The following is my staged understanding of the drawing part of drawtool.
the mainform in the program is no longer required. It is nothing more than an operation interface provided to the user. Obtain all the required parameters. The drawing part starts with the drawarea control. We can understand it as a canvas.
introduction to the drawing module:
drawarea can contain multiple layers, and each layer can contain multiple drawobjects ).
to manage multiple layers, the author creates a new layer to manage the visibility and activity of multiple layers.
Similarly, in order to manage multiple drawobjects, the author creates a graphicslist class to manage multiple drawobject objects.
based on the preceding description, the canvas, layer, and graphics are clearly displayed.
let's take a look at how to plot the image.
anyone who has used drawing tools knows that when I draw a drawing, I should first select a painting object, for example, to draw a rectangle.
the painting process can be divided into three steps: Step 1, click the left mouse button. Step 2: drag the mouse. Step 3: Use the Panasonic mouse to draw the image.
the toolobject class is a tool class used to draw graphics. It actually contains the painting process described above.
onmousedown
onmousemove
onmousedown
three steps.
the specific drawing class must inherit from this class. For example, toolrectangle must inherit from this class.
drawarea contains a tooloject set. When a user triggers
onmousedown
onmousemove
onmousedown
, the corresponding method (onmousedown, onmousemove, onmousedown.