C # Discovery Tour Seventh lecture on C # graphic Development advanced

Source: Internet
Author: User
Tags object model web database

To get a deeper understanding and use of C #, we will begin this series of technical lectures on the "C # Discovery Tour". Given that most of you are in the Web database development, and the so-called discovery is found that we are unfamiliar with the field, so this series of lectures will be C # in the Web database development outside the application. The main content of the current planning is graphic development and XML development, and plans to organize a number of courses. In the next C # Discovery Tour, we follow the step-by-step steps to explore and discover the other unknown areas of C #, a deeper understanding and mastery of the use of C # for software development, broaden our horizons, enhance our comprehensive software development capabilities.

The demo code for this series of courses, Penmarklib.zip, is the demo code for this course.

Course description

After several previous courses, I believe that we have some understanding of graphic programming, and can do their own to develop some simple graphics software. Today we demonstrate using C # to develop a graphical software that preserves signature trajectories on the basis of previous graphic development courses.

The user interface of this software is as shown

Functional Requirements

The functional requirements of the software are as follows

The user can operate to start a signature and end the signature.

While signing, the user presses the mouse button to begin drawing a line, releasing the mouse button to finish drawing a line.

A signature can contain multiple lines that are not connected.

You can save signature information to an XML document or load signature information from an XML document.

You can generate picture files that contain signed graphics.

Software Design

Implementing a functional signature function is complex, which simplifies some of the functionality that the target software only operates on signature information and does not involve documents at the time of signature. So the design of the software is as follows

Document objects

The implementation of complex graphics software is the first design document Object model, so that in-memory objects can contain the data to be displayed here, you need to design a set of object model to contain signature information.

After analysis, you can know that a document can contain several signatures, a signature contains several lines, and a line contains several points, the points in the line are connected to form lines, and the same signature lines are not connected, but can intersect.

So we can design the following document Object model

The point coordinate data list pointarraylist, which is used to hold multiple point coordinates data, where an arbitrary line segment is represented, and the program can use the Add method of the object to add point data when the user draws a line.

The Penmarkinfo object represents a signature that defines the time of the signature, the color of the line, the line width, and a number of Pointarraylist objects to hold the signature trajectory line positioning information.

The Penmarkinfodocument object represents a whole signature information object that defines multiple signature objects, and also defines methods for loading and saving document data.

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.