The realization method of editing drawing program using C language

Source: Internet
Author: User

Do not know everyone in the development of county-level power grid dispatching automation system, whether it will encounter a problem is: to draw a power system wiring diagram. Everyone should know that in fact, the power system of the first wiring diagram is more complex, if you want to use the general programming method to draw, basically is not feasible. So what should we do to be more efficient and direct? Today, the small series will give you a method, that is: the use of C language editing drawing program implementation method. I hope this tutorial is helpful for everyone.

First, the realization method

Before the beginning of the tutorial, the small series to introduce you in the programming program has already defined a few special buttons. Why do you want to introduce a few special buttons for the small series? That's because some of these special buttons can help us to complete the program development efficiently. The specific special buttons are as follows:

Special key \ \ "E": the main function is to recall the existing files;

Special key \ \ "S": The current graphic is stored in the file;

Special key \ \ "V": Lift the brush;

Special key \ \ "C": Draw a circle;

Special key \ \ "W": Start drawing a diagram;

Special key \ \ "R": Start erasing a diagram.

Well, these special keys are already introduced in the small series. Now the small series for everyone to introduce the specific way to achieve it.

When the program starts running, you can see a yellow border on your computer's screen, which is actually the area used to set the drawing. A raised brush symbol appears in the middle of the drawing area, and when you click the Special key "W", the brush symbol that you just mentioned changes to. You can use the move arrow keys (top left, bottom left, top right, bottom right, top, bottom, left, right) to draw, and when you click on the special key "R" key, the brush symbol will change. This time you can use the moving arrow keys to wipe the map, in the process of drawing, when we press the special key "C", we can draw a circle, the radius of the circle is 20 pixels. When you end the drawing, you just have to press the special key "S", you can save the picture good graphics, press the special key "E" can call up the existing graphics to do the corresponding edits.

Ii. List of source programs

Here, the small series will provide you with a list of source programs. Relatively speaking source code is still very long, so we must have patience to study down yo! The specific program code such as:

Iii. Summary of the small series

This programming program will run through in the TurboC2.0 environment, and we can also find that it is very good to use the effect. You can also according to their own actual needs, the program to expand the corresponding extension, convenient to increase the function of the drawing.

The realization method of editing drawing program using C language

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.