Use the C language to edit the implementation of the drawing program, drawing

Source: Internet
Author: User

Use the C language to edit the implementation of the drawing program, drawing

I don't know if you will encounter a problem when developing a county-level Power Grid Scheduling Automation System: drawing a wiring diagram of an electric power system. Everyone should know that the wiring diagram of a power system is complicated. If you want to use a general programming method to draw a diagram, it will basically not work. So how can we make it more efficient and direct? Today, the editor will introduce you to the implementation method of editing the drawing program using C language. I hope this tutorial will be helpful to you.


First. Implementation Method

Before the tutorial starts, let me introduce several special buttons that have already been defined in programming programs. Why should I introduce these special buttons to you? This is because several special buttons can help us efficiently complete program development. The specific buttons are as follows:

Special key \ "E": Used to call up existing files;

Special key \ "S": saves the current image to the file;

Special key \ "V": Specifies the paint brush;

Special key \ "C": draws a circle;

Special key \ "W": starts to draw a graph;

Special key \ "R": starts to erase a graph.

All right, these special keys have been introduced. Now let's take a look at the specific implementation methods.

When the program starts running, you can see a yellow border on the screen of the computer. This border is actually used to set the area of the drawing. A raised paint brush symbol appears in the middle of the drawing area. When you click the special key "W", the paint brush symbol you just mentioned changes. At this time, you can use the move direction keys (top left, bottom left, top right, bottom right, top, bottom left, right) to draw; when you click the special key "R", the paint brush symbol changes. In this case, you can use the move arrow key to clean the graph. During the drawing process, when we press the special key "C", we can draw a circle, the radius of this circle is 20 pixels. When you finish drawing, you only need to press the special key "S" to save the picture; press the special key "E" to bring up existing images for corresponding editing.

Second. source program list

Here, the editor will provide you with a list of source programs. The source code is relatively long, so you must study it with patience! The specific program code is as follows:


Third. Summary

This programming program will run in the TurboC2.0 environment, and you can also find that its use effect is very good. You can also expand the program based on your actual needs to facilitate the drawing function.


Related Article

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.