I have already introduced to you how to use GDI + to draw, and made a screenshot of the example, this article I would like to introduce you to do a similar tool for Windows drawing.
Personally think that if you want to do a powerful drawing tool, then simply mastering GDI is far from enough, my current can only do a relatively simple drawing tools. Deficiencies, welcome to discuss!
Let's take a look at the final results:
Main function: Draw a straight line, rectangles, erasers, circles, switch colors, open pictures, save pictures, clear pictures, manually adjust the canvas size; When the software is started, for a blank canvas, we can draw directly on the canvas, or we can import a picture from the "Open" menu. Then we can draw on this picture.
Platform: VS2005 WINFORM
Because the code is too much, here is only a brief introduction to the production steps, to provide you with the project download.
1. Layout of the entire interface.
2. Realize the function of drawing tools
3. To achieve the function of color pickup, here we take the last written custom control to use.
4. Implement Menu function
5. The ability to manually adjust the size of the canvas
6. Test